bài 1 - cấp trường 3
uses crt;
var a:array[1..100]of integer;
n,i,j,tam,x,dem,e:integer;
begin clrscr;
write('nhap day so nguyen:');readln(n);
for i:=1 to n do
begin
write('nhap a[',i,']:');readln(a[i]);
end;
for i:=1 to n do
for j:=1 to n do
if a[i]<a[j] then begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
writeln('sau khi sx:');
for i:= 1 to n do
writeln(a[i]:5);
write('nhap phan tu x:');readln(x);
for i:=1 to n do
if x=a[i] then
begin
dem:=dem+1;
end;
write('so lan xuat hien:',dem);
writeln;
writeln('so pt<=',x,':');
for i:= 1to n do
if a[i]<=x then write(a[i]:5);
writeln;
writeln('so pt>',x,':');
for i:=1 to n do
if a[i]>x then write(a[i]:5);
readln;
end.