Program HOC24;
var Toan,Ly,Tin,TBMToan,TBMLy,TBMTin: real;
i,n: byte;
begin
write('Nhap so ban hoc sinh trong lop: '); readln(n);
for i:=1 to n do
begin
write('Nhap diem Toan; Ly; Tin cua ban thu ',i,': ');
readln(Toan[i],Ly[i],Tin[i]);
end;
TBMToan:=0; TBMLy:=0; TBMTin:=0;
For i:=1 to n do
begin
TBMToan:=TBMToan+Toan[i];
TBMLy:=TBMLy+Ly[i];
TBMTin:=TBMTin+Tin[i];
end;
writeln('Diem trung binh mon Toan la: ',TBMToan:5:1);
writeln('Diem trung binh mon Ly la: ',TBMLy:5:1);
writeln('Diem trung binh mon Tin la: ',TBMTin:5:1);
For i:=1 to n do
writeln('Diem trung binh 3 mon cua ban thu ',i,' la: ',TBMToan+TBMLy+TBMTin:5:1);
Readln
end.