Демонстрация сортировки. после каждой строки нажимайте "enter"
program z1;
uses crt;
var i,m,j: integer;
a: array[1..10] of integer;
begin
clrscr;
randomize;
for i: = 1 to 10 do
begin
textcolor (4);
a[i]: =random(9)+1;
write (' ', a[i]);
delay(100);
end;
writeln(' ');
readln;
for j: =1 to 10 do
begin
for i: = 1 to 9 do
begin
if a[i]> a[i+1] then
begin
m: =a[i];
a[i]: = a[i+1];
a[i+1]: =m;
end;
end;
for i: = 1 to 10 do
begin
textcolor (4);
write (' ', a[i]);
delay(100);
end;
writeln(' ');
readln;
end;
writeln(' ');
for i: = 1 to 10 do
begin
textcolor (4);
write (' ', a[i]);
delay(100);
end;
readkey;
end.