|
|
back to boardDiscussion of Problem 1068. SumShow all messages Hide all messagesprogram Sum (input, output); var lI, lN : longint; begin readln (lN); if lN > 0 then lI := (lN + 1) * lN div 2; if lN = 0 then lI := 1; if lN < 0 then lI := (abs (lN) + 1) * lN div 2 + 1; writeln (lI); end. |
|
|