ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1068. Sum

please help me (problem 1068, wrong answer) I don't know why
Posted by Fellix 26 Oct 2002 17:31
var
 a, k, b: integer;

begin
readln (a);
if a>=0 then
for k:=1 to a do
b:=b+k
else
for k:=1 downto a do
b:=b+k;
writeln (b);

end.