program tinhoc;
uses crt;
var n,i,max,min:integer;
a:array[1..1000] of integer;
begin
clrscr;
writeln('Nhap so hoc sinh cua lop: ');readln(n);
for i:= 1 to n do begin
write('Diem trung binh toan cua em hs thu ',i,' : ');readln(a[i]) end;
max:=a[1]; min:=a[1];
for i:=1 to n do begin if max<a[i] then max:=a[i]; if min>a[i] then min:=a[i] end;
writeln('Diem trung binh cao nhat : ',max);
writeln('Diem trung binh thap nhat : ',min);
readln
end.