uses crt; var i,n,s:longint; a:array[1..100]of longint; begin clrscr; write(‘Nhap so luong phan tu: ‘);readln(n); for i:=1 to n do begin write(‘Nhap phan tu thu ‘,i,’: ‘);readln(a[i]); s:=s+a[i]; end; writeln(‘Trung binh cong: ‘,s/n:0:2); readln end.
uses crt;
var a: array[1..100] of integer;
i,n: integer;
tbc: real;
begin
clrscr;
write (‘nhap so phan tu: ‘); readln (n);
for i:=1 to n do
begin
write (‘nhap phan tu thu ‘,i,’: ‘); readln (a[i]);
tbc:=tbc+a[i];
end;
tbc:=tbc/n;
writeln (‘gia tri trung binh: ‘,tbc);
readln;
end.
uses crt;
var i,n,s:longint; a:array[1..100]of longint;
begin
clrscr;
write(‘Nhap so luong phan tu: ‘);readln(n);
for i:=1 to n do
begin
write(‘Nhap phan tu thu ‘,i,’: ‘);readln(a[i]);
s:=s+a[i];
end;
writeln(‘Trung binh cong: ‘,s/n:0:2);
readln
end.