const n = 10;
var
mas: array [1..n] of integer;
i,j,h:integer;
begin
randomize;
for i := 1 to n do
mas[i] := random(3);
write(' ',mas[i],' ');
end;
writeln();
for i := 1 to n - 1 do
for j := 1 to n - i do
if(mas[j] = 0) then
h := mas[j];
mas[j] := mas[j + 1];
mas[j + 1] := h;
end.
const n = 10;
var
mas: array [1..n] of integer;
i,j,h:integer;
begin
randomize;
for i := 1 to n do
begin
mas[i] := random(3);
write(' ',mas[i],' ');
end;
writeln();
for i := 1 to n - 1 do
for j := 1 to n - i do
if(mas[j] = 0) then
begin
h := mas[j];
mas[j] := mas[j + 1];
mas[j + 1] := h;
end;
for i := 1 to n do
write(' ',mas[i],' ');
end.