|
|
back to boardDiscussion of Problem 1068. SumLovi rechenie Posted by Гг 16 Oct 2008 16:15 var N,S: integer; begin readln(N); if N<=1 then begin while n<=1 do begin s:=n+s; n:=n+1; end; end else begin while n>=1 do begin s:=s+n; n:=n-1; end; end; writeln(S); end. Pascal Zaranie po>I<@luicta Re: Lovi rechenie You can solve it with more faster algorithm. Just use the sum of arithmetic progression =) |
|
|