program Tinh_tong;
uses crt;
var i,n:byte;
S:integer;
begin
clrscr;
writeln('Nhap so n='); readln(n);
i:=1 ; S:=0;
while i<=n do
begin
S:=S+i; i:=i+1;
end;
writle('Tong n so tu nhien dau tien, S=',S);
end.
function sum_n(n: integer): integer;
var
i, sum: integer;
begin
sum := 0;
i := 1;
while i <= n do
begin
sum := sum + i;
i := i + 1;
end;
sum_n := sum;
end;