nhập vào điểm toán và văn của học sinh trong lớp xếp loại học sinh như sau giỏi:nếu điểm toán + điểm văn >=18 khá: nếu điểm toán +điểm văn >=16 tb:nếu điểm toán + điểm văn >=12 còn lại là yếu
2 câu trả lời
program ct;
uses crt;
var T,V:real;
begin
clrscr;
write('nhap diem toan=');readln(T);
write('nhap diem van=');readln(V);
if (T+V)>=18 then writeln('Gioi');
if (T+V)>=16 and (T+V)<18 then writeln('kha');
if (T+V)>=12 and (T+V)<16 then writeln('trung binh');
if (T+V)<12 then writeln('yeu');
readln
end.
program ct;
uses crt;
var T,V:array[1..100] of real;
i,n:integer;
begin clrscr;
write('Nhap so hoc sinh: '); readln(n);
for i:=1 to n do
begin
write('Nhap diem toan cua hs thu ',i,': '); readln(T[i]);
write('Nhap diem van cua hs thu ',i,': '); readln(V[i]);
end;
for i:=1 to n do
begin
if T[i]+V[i]>=18 then writeln('Hs thu ',i,': Gioi');
if (T[i]+V[i]>=16) and (T[i]+V[i]<18) then writeln('Hs thu ',i,': Kha');
if (T[i]+V[i]>=12) and (T[i]+V[i]<16) then writeln('Hs thu ',i,': Trung binh');
if T[i]+V[i]<12 then writeln('Hs thu ',i,': Yeu');
end;
readln;
end.
Học tốt!