Lời giải :
program hotrontinhoc ;
var Toan : array[1..42] of real ;
Van : array[1..42] of real;
Anh : array[1..42] of real ;
i : integer ;
DTB : real ;
begin
begin
writeln('Nhap diem mon Toan cua cac ban');
for i:=1 to 42 do
begin
write('Diem cua ban thu',i,':'); readln(Toan[i]);
end;
end;
begin
writeln('Nhap diem mon Van cua cac ban');
for i:=1 to 42 do
begin
write('Diem cua ban thu ',i,':'); readln(Van[i]);
end;
end;
begin
writeln('Nhap diem mon Anh cua cac ban');
for i:= 1 to 42 do
begin
write('Nhap diem cua ban thu ',i,':'); readln(Anh[i]);
end;
end;
DTB:=0;
for i:= 1 to 42 do
DTB:= DTB+(Toan[i]/i)+(Van[i]/i)+(Anh[i]/i);
write('Diem trung binh cong cua 3 mon la:',DTB:2:4);
readln
end.
program hotrontinhoc ;
var Toan : array[1..42] of real ;
Van : array[1..42] of real;
Anh : array[1..42] of real ;
i : integer ;
DTB : real ;
begin
begin
writeln('Nhap diem mon Toan cua cac ban');
for i:=1 to 42 do
begin
write('Diem cua ban thu',i,':'); readln(Toan[i]);
end;
end;
begin
writeln('Nhap diem mon Van cua cac ban');
for i:=1 to 42 do
begin
write('Diem cua ban thu ',i,':'); readln(Van[i]);
end;
end;
begin
writeln('Nhap diem mon Anh cua cac ban');
for i:= 1 to 42 do
begin
write('Nhap diem cua ban thu ',i,':'); readln(Anh[i]);
end;
end;
DTB:=0;
for i:= 1 to 42 do
DTB:= DTB+(Toan[i]/i)+(Van[i]/i)+(Anh[i]/i);
write('Diem trung binh cong cua 3 mon la:',DTB:2:4);
readln
end.