|
|
back to boardDiscussion of Problem 1068. Sumvar a:array[1..10000]of integer; n,i,d,s:integer; begin read(n); for i:=1 to n do if abs(n)<10000 then if n<=0 then d:=-1 else d:=1; S:=((2+(n-1)*d)*n div 2 )); write(s); end. (12,26) Fatal: Syntax error, ";" expected but ")" found Your wrong in: S:=((2+(n-1)*d)*n div 2 )); I think right: S:=((2+(n-1)*d)*n div 2); |
|
|