Program v;
uses crt;
const n=10;
var a: array [1..n] of integer;
i,k,j: integer;
BEGIN
Randomize;
WriteLN('Массив А: ');
For i:= 1 to n do begin
a[i]:= random(100)-10;
Wite(a[i]:5);
end;
WRITELN;WRITELN;
For i := 1 to n-1 do begin
For j := 1 to n-i do begin
If a[j] > a[j+1] then begin
k := a[j];
a[j] := a[j+1];
a[j+1] := k
WriteLN('Отсортированный массив: ');
WRITELN;
For i := 1 to n do
Write(a[i]:5);
READKEY;
END.
Program v;
uses crt;
const n=10;
var a: array [1..n] of integer;
i,k,j: integer;
BEGIN
Randomize;
WriteLN('Массив А: ');
For i:= 1 to n do begin
a[i]:= random(100)-10;
Wite(a[i]:5);
end;
WRITELN;WRITELN;
For i := 1 to n-1 do begin
For j := 1 to n-i do begin
If a[j] > a[j+1] then begin
k := a[j];
a[j] := a[j+1];
a[j+1] := k
end;
end;
end;
WriteLN('Отсортированный массив: ');
WRITELN;
For i := 1 to n do
Write(a[i]:5);
READKEY;
END.