const
N = 15;
var
a: array[1..N] of integer;
i, j, tmp: integer;
begin
for i := 1 to N do begin
a[i] := random(50);
write(a[i], ' ');
end;
writeln;
for i := 1 to N - 1 do
for j := 1 to N - i do
if a[j] > a[j+1] then begin
tmp := a[j];
a[j] := a[j+1];
a[j+1] := tmp
end;
write('По возрастанию: ');
for i := 1 to N do
write(a[i], ' ');
end.