2 câu trả lời
var
n,i,kq: integer;
begin
readln (n);
for i:= 1 to n do kq:= kq + i;
writeln (kq);
readln;
end.
uses crt;
var i,s,n: integer;
begin
clrscr;
write('Nhap vao so n = ');readln(n);
i:=1;
s:=0;
while i<=n do
begin
s:=s+i;
inc(i);
end;
writeln('Tong cua ',n,' so tu nhien dau tien la ',S);
readln;
end.
Chúc bạn học tốt!