Lời giải :
program hotrotinhoc ;
var a : array[1..32000] of integer ;
i,n,j,tg : integer ;
begin
write('Nhap do dai cua day so :'); readln(n);
for i:= 1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
for i:= 1 to n do
for j:= 1 to n-1 do
if a[i]>a[j] then
begin
tg:=a[i];
a[i]:=a[j];
a[j]:=tg;
end;
write('Mang sau khi sap xep la : ');
for i:= 1 to n do write(a[i],' ');
readln
end.