PROGRAM CT78;
USES crt;
TYPE Hocsinh = RECORD
Ten, Namsinh,Que: STRING; {Name}
TBM: REAL; {Diem Trung Binh Mon}
END;
VAR A: ARRAY[1..45] OF Hocsinh;
g,k,tb,i: BYTE;
n:WORD;
BEGIN
clrscr;
n:=46;
WHILE n>=45 DO BEGIN
Write('Lop ban co bao nhieu nguoi: '); Readln(n); END;
FOR I:=1 TO n DO
BEGIN
Write('Ten hoc sinh ',i,': '); Readln(A[i].Ten);
Write('Nam sinh: '); Readln(A[i].Namsinh);
Write('Que: '); Readln(A[i].Que);
Write('Diem trung binh mon: '); Readln(A[i].TBM);
END;
Writeln; Writeln; Writeln;
FOR i:=1 TO n DO IF A[i].TBM >= 8.0 THEN BEGIN g:=g+1; Write(A[i].Ten); GotoXY(31,wherey);
Write(A[i].Namsinh,' ',A[i].Que,' '); GotoXY(60,wherey); Writeln(' Gioi'); END
ELSE IF A[i].TBM >= 6.5 THEN BEGIN k:=k+1; Write(A[i].Ten); GotoXY(31,wherey);
Write(A[i].Namsinh,' ',A[i].Que,' '); GotoXY(60,wherey); Writeln(' Kha'); END
ELSE
BEGIN tb:=tb+1; Write(A[i].Ten);
GotoXY(31,wherey); Write(A[i].Namsinh,' ',A[i].Que,' '); GotoXY(60,wherey); Writeln(' Trung Binh'); END;
Writeln('So hoc sinh Gioi la: ',g); Writeln(' Kha la: ',k);
Write(' Trung binh: ',tb);
Readln
END.
Download: http://www.mediafire.com/?oqj982e3fasqa76
USES crt;
TYPE Hocsinh = RECORD
Ten, Namsinh,Que: STRING; {Name}
TBM: REAL; {Diem Trung Binh Mon}
END;
VAR A: ARRAY[1..45] OF Hocsinh;
g,k,tb,i: BYTE;
n:WORD;
BEGIN
clrscr;
n:=46;
WHILE n>=45 DO BEGIN
Write('Lop ban co bao nhieu nguoi: '); Readln(n); END;
FOR I:=1 TO n DO
BEGIN
Write('Ten hoc sinh ',i,': '); Readln(A[i].Ten);
Write('Nam sinh: '); Readln(A[i].Namsinh);
Write('Que: '); Readln(A[i].Que);
Write('Diem trung binh mon: '); Readln(A[i].TBM);
END;
Writeln; Writeln; Writeln;
FOR i:=1 TO n DO IF A[i].TBM >= 8.0 THEN BEGIN g:=g+1; Write(A[i].Ten); GotoXY(31,wherey);
Write(A[i].Namsinh,' ',A[i].Que,' '); GotoXY(60,wherey); Writeln(' Gioi'); END
ELSE IF A[i].TBM >= 6.5 THEN BEGIN k:=k+1; Write(A[i].Ten); GotoXY(31,wherey);
Write(A[i].Namsinh,' ',A[i].Que,' '); GotoXY(60,wherey); Writeln(' Kha'); END
ELSE
BEGIN tb:=tb+1; Write(A[i].Ten);
GotoXY(31,wherey); Write(A[i].Namsinh,' ',A[i].Que,' '); GotoXY(60,wherey); Writeln(' Trung Binh'); END;
Writeln('So hoc sinh Gioi la: ',g); Writeln(' Kha la: ',k);
Write(' Trung binh: ',tb);
Readln
END.
Download: http://www.mediafire.com/?oqj982e3fasqa76