program delin;
const
nn = 100;// максимальный размер массива
var
i, j, n, t: integer;
a: array[1..nn] of integer;
begin
write('n = ');
read(n);
randomize;
for i := 1 to n do
a[i] := random(38) - 9;
write(a[i], ' ');
end;
writeln;
for i := n - 1 downto 1 do
for j := 1 to i do
if a[j] > a[j + 1] then
t := a[j];
a[j] := a[j + 1];
a[j + 1] := t;
end.
program delin;
const
nn = 100;// максимальный размер массива
var
i, j, n, t: integer;
a: array[1..nn] of integer;
begin
write('n = ');
read(n);
randomize;
for i := 1 to n do
begin
a[i] := random(38) - 9;
write(a[i], ' ');
end;
writeln;
for i := n - 1 downto 1 do
for j := 1 to i do
if a[j] > a[j + 1] then
begin
t := a[j];
a[j] := a[j + 1];
a[j + 1] := t;
end;
for i := 1 to n do
write(a[i], ' ');
end.