program tinhtong;
var S,n : integer ;
i : integer ;
begin
S :=0 ;
write ('nhap gia tri cua n ='); readln (n);
for i :=1 to n do S := S+i ;
write ('vay tong S =,'S);
readln ;
end.
uses crt;
var s,i,n:integer;
begin
clrscr;
write('Nhap n='); readln(n);
s:=0;
i:=1;
while i<=n do
begin
s:=s+i;
inc(i);
end;
writeln(s);
readln;
end.