Program hoc24;
var i,n: integer;
t: real;
begin
write('Nhap n : '); readln(n);
t:=0;
for i:=1 to n do t:=t+i;
write('Trung binh tong cac so tu 1 den ',n,' la: ',t/n:1:2);
readln
end.
uses crt;
var n,i,t:longint;
begin
clrscr;
write('Nhap n='); readln(n);
t:=0;
for i:=1 to n do
t:=t+i;
writeln('Trung binh tong la: ',t/n:4:2);
readln;
end.