Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
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.
uses crt;
var a,b,c:real;
begin
clrscr;
write('Nhap diem Toan:'); readln(a);
write('Nhap diem Van:'); readln(b);
write('Nhap diem Anh:'); readln(c);
writeln('Diem trung binh la: ',(a+b+c)/3:4:2);
readln;
end.
program TinhTBCMon;
var
n, i: integer;
diemAnh, diemVL, tongDiemAnh, tongDiemVL: real;
begin
tongDiemAnh := 0;
tongDiemVL := 0;
write('Nhap so hoc sinh: ');
readln(n);
for i := 1 to n do
begin
write('Nhap diem Tieng Anh cua hoc sinh ', i, ': ');
readln(diemAnh);
tongDiemAnh := tongDiemAnh + diemAnh;
write('Nhap diem Vat ly cua hoc sinh ', i, ': ');
readln(diemVL);
tongDiemVL := tongDiemVL + diemVL;
end;
writeln('Diem trung binh mon Tieng Anh cua lop la: ', tongDiemAnh/n:0:2);
writeln('Diem trung binh mon Vat ly cua lop la: ', tongDiemVL/n:0:2);
readln;
end.