Quan ly HS
Program QLHS;
Type hocsinh=record;
maso: byte;
hoten: string[30];
dtin: real;
end;
Var hs: array[1..60] of hocsinh;
n, i, ts: byte;
s, dtb: real;
Begin
write ('nhap so hs n: '); readln(n);
for i:=1 to n do
begin
writeln ('nhap hs ', i, ' :');
writeln ('ma so: '); readln (hs[i].maso);
writeln ('ho ten: '); readln (hs[i].hoten);
writeln ('diem Tin: '); readln (hs[i].dtin);
end;
s:=0;
for i:=1 to n do
s:=s + hs[i].dtin;
dtb:= s/n;
ts:=0;
for i:=1 to n do
if hs[i].dtin >= 5 then
ts:= ts+1;
writeln ('hoc sinh ', hs[4].hoten, ' ', hs[4].dtin:6:1, ' diem');
writeln ('DTB Tin ca lop: ', dtb:6:1);
writeln ('Tong so HS co diem Tin >=5: ', ts:6);
readln;
end.
Bạn đang đọc truyện trên: AzTruyen.Top