|
|
вернуться в форумWhat's the diference? Послано Oscar 16 окт 2002 22:54 I've submited this code and I always get WA, then I changed the code to simple for loops and got it accepted, but I'm still trying to understand why this one does not work. Anyone can help me? var n, i, res, k: longint; Begin read(input, n); if n<0 then k:=-n else k:= n; for i:= 1 to k do res:= res + i; if n = 0 then write(output, 1) else begin if n < 0 then write(output, (res - 1)* -1) else write(output, res); end; End. |
|
|