program Tinh_Tong;
var n, s, i: integer;
begin
write('Nhap vao so nguyen duong n: ');
readln(n);
s := 0;
i := 1;
while i <= n do
begin
s := s + i;
i := i + 1;
end;
writeln('Tong cua ', n, ' so tu nhien dau tien la: ', s);
end.
Đúng 1
Bình luận (0)