|
|
back to boardDiscussion of Problem 1068. SumI got AC with a program which has only 6 lines. I don't believe!! var n,i:longint; begin readln(n); if n>=1 then writeln((n+1)*n div 2) else writeln((n+1)*(2-n) div 2); end. Oh, you are great programmer! Re: Oh, you are great programmer! It is a sum of arifmetical progression! Re: Oh, you are great programmer! Thank you very much!! Re: I got AC with a program which has only 6 lines. U are verry-verry clever person!!! Nothing special. Everybody can see that. And I can reduce the length of prog by 1 byte(+) change n>=1 into n>0 :) -_- Posted by kcm1700 13 Jun 2005 17:16 so what,,, I did it in 3 lines. Re: I got AC with a program which has only 6 lines. Posted by Lunar 19 Jul 2006 06:41 I think one line is OK. Re: I got AC with a program which has only 6 lines. Posted by javran 14 Oct 2006 13:38 it is very good. |
|
|