|
|
вернуться в форум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 You can solve it with more faster algorithm. Just use the sum of arithmetic progression =) |
|
|