Tham khảo bạn nhé ^^
program tinhtong;
uses crt;
var i,n:integer;
s:longint;
begin
for i:=1 to 100 do s:=s+i;
write('tong s=',s);
readln;
end. Mình có làm thử trên Free Pascal rồi nhé! Chúc bạn thi tốt
Tham khảo bạn nhé ^^
program tinhtong;
uses crt;
var i,n:integer;
s:longint;
begin
for i:=1 to 100 do s:=s+i;
write('tong s=',s);
readln;
end. Mình có làm thử trên Free Pascal rồi nhé! Chúc bạn thi tốt
Bạn thay biến s:integer; i:byte;
program tinhtong;
uses crt;
var s,n:integer;
i:byte;
begin
for i:=1 to 100 do s:=s+i;
write('tong s=',s);
readln;
end.