|
|
вернуться в форумwhat's wrong with this program? I got wa var p,a,n:longint; begin readln(n); p:=n; while (2*n mod p<>0) or ((2*n-(p+1)*p)<0) do if p>0 then dec(p) else halt; a:=(2*n-(p-1)*p) div (2*p); writeln(a,' ',p); end. WA > var p,a,n:longint; > begin > readln(n); p:=n; > while (2*n mod p<>0) or > ((2*n-(p+1)*p)<0) > do if p>0 then dec(p) else halt; > a:=(2*n-(p-1)*p) div (2*p); > writeln(a,' ',p); > end. |
|
|