viet chuong trinh tinh tong cua N so tu nhien dau tien sao cho tong nho nhat lon hon 2021 21/07/2021 Bởi Eden viet chuong trinh tinh tong cua N so tu nhien dau tien sao cho tong nho nhat lon hon 2021
program tong; uses crt; var N,T: integer; Begin N:=1; while T<=2021 do begin N:=N+1; T:=T+N; end; writeln(‘T = ‘,T); write(T,’ la tong cua ‘,N,’ so tu nhien); readln End. Bình luận
program tong;
uses crt;
var N,T: integer;
Begin
N:=1;
while T<=2021 do
begin
N:=N+1;
T:=T+N;
end;
writeln(‘T = ‘,T);
write(T,’ la tong cua ‘,N,’ so tu nhien);
readln
End.