uses crt;
var m,h,b,t,n: Integer;
Tbc: real;
begin
clrscr;
write('Nhap 5 so tu nhien: '); readln(m,h,b,t,n);
tbc:= (m+h+b+t+n)/5;
If (m >= 0) and (h>=0) and (b >=0) and (t >=0) and (n>=0) then writeln('Trung binh cong cua nam so do la ',tbc:1:2);
readln;
end.
uses crt;
var a:array[1..5]of integer;
i,t:integer;
tbc:real;
begin
clrscr;
for i:=1 to 5 do
begin
write('a[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to 5 do
t:=t+a[i];
tbc:=t/5;
writeln('trung binh cong cua 5 so tu nhien vua nhap la: ',tbc:4:2);
readln;
end.
Program trung_binh_cong;
uses crt;
var a,b,c: real;
begin
clrscr;
write('nhap so a , b , c =' ,); readln(a,b,c):
writeln('trung binh cong cua 3 so = ' ,(a+b+c) / 3);
readln;
end.
program ho_tro;
uses crt;
var a,b,c,d,e,tb: real;
begin
clrscr;
writeln(' nhap nam so:'); readln(a,b,c,d,e);
tb:=(a+b+c+d+e)/5;
writeln(' trung binh nam so la:',tb);
readln;
end.