|
|
back to boardHelp! I got Compilation Error! But I don't Know Why? Posted by TheBeet 28 Jul 2006 13:06 here is my code: No Error... var ti,tn,i,n,m,a,b:longint; begin readln(tn); for ti:=1 to tn do begin readln(a,b); if ((b mod a)<>0) then begin writeln('0');continue;end; b:=b div a; m:=1; for i:=2 to trunc(sqrt(b)) do if ((b mod i)=0) then begin b:=b div i; m:=m+1; i:=i-1; end; if (b>1) then inc(m); writeln(m); end; end. Edited by author 28.07.2006 13:08 Re: Help! I got Compilation Error! But I don't Know Why? Posted by TheBeet 28 Jul 2006 13:13 And if i change "i:=i-1;" to "{i:=i-1;}" I will got WA1. var ti,tn,i,n,m,a,b:longint; begin readln(tn); for ti:=1 to tn do begin readln(a,b); if ((b mod a)<>0) then begin writeln('0');continue;end; b:=b div a; m:=1; for i:=2 to trunc(sqrt(b)) do if ((b mod i)=0) then begin b:=b div i; m:=m+1; {########i:=i-1;##########} end; if (b>1) then inc(m); writeln(m); end; end. Re: Help! I got Compilation Error! But I don't Know Why? Posted by TheBeet 28 Jul 2006 13:19 I have got AC. I just change "for" to "while". |
|
|