uses crt;
var a:array[1..100]of real;
i,n,j:integer;
tam:real;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
writeln('Day tang dan la: ');
for i:=1 to n do
write(a[i]:4:2,' ');
writeln;
writeln('Day giam dan la: ');
for i:=n downto 1 do
write(a[i]:4:2,' ');
readln;
end.