|
|
вернуться в форум1068 here is my code. pls help me to figure out the mistake i have made?! program asdl; var i,n : integer; k : int64; begin readln(n); k := 0; if n > 1 then for i := 1 to n do k := k + i; if n = 0 then k := 1; if n <= 0 then begin for i := 1 to -n do k := k + i; k := -k + 1; end; write(k); end. Re: 1068 Hi. Try to change n > 1 to n > 0 and n <= 0 to n < 0 Edited by author 24.05.2015 15:42 |
|
|