Const N = 10; var a: array[1..N] of integer; i, j, k: integer; begin write ('Исходный массив: '); for i := 1 to N do begin a[i] := random(100); write (a[i]:4); end; writeln; writeln; for i := 1 to N-1 do for j := 1 to N-i do if a[j] > a[j+1] then begink := a[j]; a[j] := a[j+1]; a[j+1] := k; end; write ('Отсортированный массив: '); for i := 1 to N do write (a[i]:4); writeln; readln; end.
var a: array[1..N] of integer;
i, j, k: integer;
begin
write ('Исходный массив: ');
for i := 1 to N do
begin
a[i] := random(100);
write (a[i]:4);
end;
writeln;
writeln;
for i := 1 to N-1 do
for j := 1 to N-i do
if a[j] > a[j+1] then
begink := a[j];
a[j] := a[j+1];
a[j+1] := k;
end;
write ('Отсортированный массив: ');
for i := 1 to N do write (a[i]:4);
writeln;
readln;
end.