program baitap;
Uses Crt;
Var a:array[1..100] of integer;
i,j,n,m,hsg,k:longint;
Begin
Clrscr;
Write('Nhap so ptu N= '); Readln(n);
For i:=1 to n do
Begin
Write(' Nhap diem mon toan cho hs[',i,'] = '); Readln(hs[i]);
If a[i]>=8 then hsg:=hsg+1;
If a[i]<5 then k:=k+1;
End;
Write('Thu tu cac hs co diem cao nhat: ');
For i:=1 to n-1 do
For j:=j+1 to n do
if a[i]>a[j] then
begin
m:=a[i];
a[i]:=a[j];
a[j]:=m;
end;
For i:= 1 to n do write(a[i],' ');
Writeln;
Write('So hoc sinh gioi la: ',hsg,'. Ti le chiem: ',hsg/n*100,'%');
Writeln;
Write('So hoc sinh duoi diem 5 la: ',k,'. Ti le chiem: ',k/n*100,'%');
Readln;
End.