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

1068 ??? It always gave me WRONG ANSWER although when I test it I can't find the mistake
Posted by Ivo 25 May 2001 04:05
Here's the source can you help me!

var i,sum1,n:longint;
begin
   readln(n);
   sum1:=0;
   if n=1 then sum1:=2
   else
     if n<=0 then
       for i:=1 downto n do  sum1:=sum1+i;
     else
       for i:=1 to n do  sum1:=sum1+i;
   writeln(sum1);
end.