Var n,s:integer;
Begin
n:=0;
While s<=1000 do
begin
n:=n+1;
s:=s+n;
End;
Write('Tong dau tien lon hon 1000 la ',s);
Readln;
End.
Tham khảo link: https://hoc24.vn/cau-hoi/viet-chuong-trinh-tinh-tong-cua-n-so-tu-nhien-dau-tien-sao-cho-tong-nho-hon-hoac-bang-1000giup-minh-voi-thu-6-thi-roi.180444032537