Program Xep_loai_HL;
Uses crt;
Var DTB:Real;
Begin
clrscr;
write('Nhap DTB cua hoc sinh = ');
readln(DTB);
If DTB > = 8 then
write('Xep loai gioi')
else
If DTB > = 6.5 then
write('Xep loai kha')
else
If DTB > = 5 then
write('Xep loai TB')
else
write('Xep loai yeu - kem');
Readln;
End.
minh sữa lại bài của cậu như sau :
hok pik lỗi chỗ nào mà vẫn ko chạy dc
Program Xep_loai_HL;
Uses crt;
Var DTB,DLT,DTH:Real;
Begin
clrscr;
write('Nhap DTH cua hoc sinh = ');
readln(DTH);
write('Nhap DLT cua hoc sinh = ');
readln(DLT);
DTB := (DTH + DLT)/2
If DTB > = 8 then
write('Xep loai gioi')
else
If DTB > = 6.5 then
write('Xep loai kha')
else
If DTB > = 5 then
write('Xep loai TB')
else
write('Xep loai yeu - kem');
Readln;
End.
program KQ;
uses crt;
var
dtb,lt,th:real;
hoten,sbd,ketqua,xeploai:string;
Begin
clrscr;
write('Nhap SBD : '); readln(sbd);
write('ho ten :');readln (hoten);
write('Nhap diem thuc hanh: ');readln(th);
write('Nhap diem ly thuyet: ');readln(lt);
dtb:=(lt+th)/2;
if dtb>= 5 then
begin
ketqua:='Dau';
if dtb >=8 then xeploai:='Gioi'
else if dtb >=6.5 then xeploai := 'kha'
else ketqua := 'Trung binh';
end
else
begin
ketqua := 'rot';
xeploai:='kem';
end;
clrscr;
writeln('----KET QUA----');
writeln('sbd: ', sbd);
writeln('ho ten: ', hoten);
writeln('diem ly thuyet: ',lt:10:2);
writeln('diem th: ',th:10:2) ;
writeln('diem tb: ',dtb:10:2);
writeln ('Ket qua: ',ketqua);
writeln('xep loai: ',xeploai);
writeln('-------------------');
writeln('enter de ket thuc');
readln
End.