|
|
back to boardDiscussion of Problem 1068. SumDO U MIND TELLING ME WHAT'S WRONG WITH THIS? Posted by Khosrow 25 Jun 2007 19:54 here is my program; program khosrow; var n:longint; begin readln(n); if n<0 then writeln((n*(1-n) div 2)+1) else writeln((n*(n+1)) div 2); end. Re: DO U MIND TELLING ME WHAT'S WRONG WITH THIS? var n:longint; begin readln(n); if n<=0 then writeln((n*(1-n) div 2)+1) else writeln((n*(n+1)) div 2); end. This is AC Re: DO U MIND TELLING ME WHAT'S WRONG WITH THIS? Posted by Khosrow 27 Jun 2007 22:39 thanks:D |
|
|