|
|
back to boardWhy I got WA? Posted by qwt 7 Feb 2002 06:09 var n,i:integer; begin readln(n); while n mod 2=0 do n:=n div 2; for i:=2 to n-1 do if n mod (i+1)=0 then break; writeln(i); end. Try a test N=7 (rigth answer=6) > var > n,i:integer; > begin > readln(n); > while n mod 2=0 do n:=n div 2; > for i:=2 to n-1 do if n mod (i+1)=0 then break; > writeln(i); > end. when input is 7,the output is 6, is right Posted by qwt 8 Feb 2002 10:14 |
|
|