a410.
解方程
--
TYVJ
| From: [183.46.145.106] |
發表日期
:
2014-11-02 12:13
program a410;
var a,b,c,d,e,f,xz,yz,i,j:longint;
x,y:real;
procedure abc();
begin
xz:=trunc(x);
yz:=trunc(y);
for i:=1 to 100 do
begin
xz:=xz div 10;
if xz=0 then break;
end;
for j:=1 to 100 do
begin
yz:=yz div 10;
if yz=0 then break;
end;
writeln('x=',x:i:2);
writeln('y=',y:i:2);
end;
begin
while not eof do
begin
readln(a,b,c,d,e,f);
if (a=0) and (b=0) and (c=0) and (d=0) then writeln('Too many') else
if b=0 then begin if e=0 then begin if c/a=f/d then writeln('Too many')
else writeln('No answer') end
else begin
x:=c/a;
y:=-(d/e)*x+f/e;
abc;
end;
end
else begin if e=0 then begin
x:=f/d;
y:=-(a/c)*x+c/b;
abc;
end else begin
if -a/b=-d/e then begin if c/b=f/e then writeln('Too many')
else writeln('No answer') end
else begin
x:=(f-(e*c/b))/(d-(e*a/b));
y:=-(a/b)*x+c/b;
abc;
end end;
end;
end;
end.
测资点9总是过不了。。。
输出空格什么的就说答案错误 正确答案是是输出‘Too many'
但输出‘Too many'就总是说 “冗除输出 请勿输出题目不需要的文字 ”