|
|
вернуться в форумPASCAL AC Solution 9 lines!!!! var n,i:longint; begin read(n); if n<=0 then begin n:=n*-1; write(((n*(n+1))div 2)*-1+1); end else writeln(n*(n+1)div 2); end. Edited by author 13.04.2010 16:42 Edited by author 13.04.2010 16:43 Your solution too big! Use single formula, without 'if'-condition. Hint: Use Abs() |
|
|