Program HOC24;
var i,s: integer;
begin
s:=0; i:=1;
while s<=22 do
begin
s:=s+i;
i:=i+1;
end;
s:=s-i;
write('Tong la: ',s);
readln
end.
program sum_of_naturals;
var
i, n, sum: integer;
begin
n := 1;
sum := 0;
while sum + n <= 22 do
begin
sum := sum + n;
n := n + 1;
end;
writeln('The sum of the first ', n-1, ' natural numbers is ', sum);
end.