|
|
back to boardWhy WA #5? Posted by nastya 22 Jun 2008 19:47 The follwing is my pgm. Could some give a test case not satisfied here? var s1,i:integer; f:boolean; a2,b2,a1,b1,a,b:real; begin f:=false; read(a); read(b); a1:=a/100; b1:=b/100; if b<>0 then i:=trunc(1/b1); a2:=a1*(i); b2:=b1*(i); while not f do begin if (((trunc(b2)<>trunc(a2)))and (frac(b2)<>0) then f:=true; a2:=a2+a1; b2:=b2+b1; i:=i+1; end; i:=i-1; writeln(i);
end. Re: Why WA #5? Got ac by using double not float by accepting the input, so wired. |
|
|