Program Diem_Trung_binh;
Uses Crt;
Var
Ten:String[24];
Van,Toan,Ly,tb:Real;
Begin
Clrscr;
Writeln('TINH DIEM TRUNG BINH VA XEP HANG');
Writeln('--------------------------------');
Write('-Cho biet ho ten: ');
Readln(Ten);
Write('-Cho biet diem mon Van: ');
Readln(Van);
Write('-Cho biet diem mon Toan: ');
Readln(Toan);
Write('-Cho biet diem mon Ly: ');
Readln(Ly);
Tb:=((Van*2)+(Toan*2)+ly)/5;
If tb < 5 Then
Begin
Writeln('+Hoc sinh: ',Ten);
Writeln('+Diem trung binh = ',Tb:4:1);
Writeln('+Xep hang: Hoc luc kem');
End
Else if Tb < 7 Then
Begin
Writeln('+Hoc sinh: ',Ten);
Writeln('+Diem trung binh = ',Tb:4:1);
Writeln('+Xep hang: Hoc luc trung binh');
End
Else if Tb < 9 Then
Begin
Writeln('+Hoc sinh: ',Ten);
Writeln('+Diem trung binh = ',Tb:4:1);
Writeln('+Xep hang: Hoc luc Kha');
End
Else
Begin
Writeln('+Hoc sinh: ',Ten);
Writeln('+Diem trung binh = ',Tb:4:1);
Writeln('+Xep hang: Hoc luc Gioi');
End;
Writeln;
Writeln(' Bam phim <Enter> de ket thuc');
Readln;
End.
Program Diem_Trung_binh;
Uses Crt;
Var
Ten:String[24];
Van,Toan,Ly,tb:Real;
Begin
Clrscr;
Writeln('TINH DIEM TRUNG BINH VA XEP HANG');
Writeln('--------------------------------');
Write('-Cho biet ho ten: ');
Readln(Ten);
Write('-Cho biet diem mon Van: ');
Readln(Van);
Write('-Cho biet diem mon Toan: ');
Readln(Toan);
Write('-Cho biet diem mon Ly: ');
Readln(Ly);
Tb:=((Van*2)+(Toan*2)+ly)/5;
If tb < 5 Then
Begin
Writeln('+Hoc sinh: ',Ten);
Writeln('+Diem trung binh = ',Tb:4:1);
Writeln('+Xep hang: Hoc luc kem');
End
Else if Tb < 7 Then
Begin
Writeln('+Hoc sinh: ',Ten);
Writeln('+Diem trung binh = ',Tb:4:1);
Writeln('+Xep hang: Hoc luc trung binh');
End
Else if Tb < 9 Then
Begin
Writeln('+Hoc sinh: ',Ten);
Writeln('+Diem trung binh = ',Tb:4:1);
Writeln('+Xep hang: Hoc luc Kha');
End
Else
Begin
Writeln('+Hoc sinh: ',Ten);
Writeln('+Diem trung binh = ',Tb:4:1);
Writeln('+Xep hang: Hoc luc Gioi');
End;
Writeln;
Writeln(' Bam phim <Enter> de ket thuc');
Readln;
End.
uses crt;
var toan,ly,hoa,van:byte; tb:real; ten:string;
Begin
clrscr;
write('Tinh dtb va Xep hang');
writeln('Nhap ten hs: ');
readln(ten);
write('Nhap diem Toan Ly Hoa Van: ');
readln(toan,ly,hoa,van);
tb:=(toan+ly+hoa+van)/4 (mấy môn này bình đẳng)
write(ten,tb:3:1,' ');
if tb>=8.0 then write('Hluc: Gioi');
else if tb>=6.5 then write('Hluc: Kha');
else if tb>=5.0 then write('Hluc: Tb');
else write('Hluc: Yeu');
readln
End.