|
|
back to boardWhy I always WA This is my code,I can't find mistakes, but it keeps WA: program zxx(input,output); var temp,p,q:extended; i,n:integer; f:boolean; begin read(p,q); if q<p then begin temp:=q;q:=p;p:=temp end; p:=p/100;q:=q/100; i:=0; f:=false; repeat i:=i+1; if (trunc(i*p+1)<=trunc(i*q)) or (trunc(i*p)=i*p) or (trunc(i*q)=i*q) then f:=true; until(f); write(i); end. |
|
|