While..do
Program HOC24;
var i: integer;
s: longint;
begin
s:=0; i:=1;
while i<=2018 do
begin
s:=s+i;
i:=i+1;
end;
write('S = ',s);
readln
end.
For..do
Program HOC24;
var i: integer;
s: longint;
begin
s:=0;
For i:=1 to 2018 do s:=s+i;
write('S = ',s);
readln
end.