program raf105;
const
n = 10; //Размер массива
var
a,b,c: array[1..n] of integer;
x,i,j,b2,c2,min,minpos: integer;
begin
write('Введите число: ');
readln(x);
writeln('Вводите числа по очереди');
for i:=1 to n do
readln(a[i]);
if a[i] > x
then begin
c2:= c2+1;
c[c2]:= a[i];
end
else begin
b2:= b2+1;
b[b2]:= a[i];
end;
for i:=1 to b2 do
min:= b[i];
minpos:= i;
for j:=i to b2 do
if b[j] < min
min:= b[j];
minpos:= j;
b[minpos]:= b[i];
b[i]:= min;
a[i]:= b[i];
for i:=1 to c2 do
a[i+b2]:= c[i];
write('Вывод: ');
write(a[i],' ');
end.
program raf105;
const
n = 10; //Размер массива
var
a,b,c: array[1..n] of integer;
x,i,j,b2,c2,min,minpos: integer;
begin
write('Введите число: ');
readln(x);
writeln('Вводите числа по очереди');
for i:=1 to n do
begin
readln(a[i]);
if a[i] > x
then begin
c2:= c2+1;
c[c2]:= a[i];
end
else begin
b2:= b2+1;
b[b2]:= a[i];
end;
end;
for i:=1 to b2 do
begin
min:= b[i];
minpos:= i;
for j:=i to b2 do
if b[j] < min
then begin
min:= b[j];
minpos:= j;
end;
b[minpos]:= b[i];
b[i]:= min;
end;
for i:=1 to b2 do
a[i]:= b[i];
for i:=1 to c2 do
a[i+b2]:= c[i];
write('Вывод: ');
for i:=1 to n do
write(a[i],' ');
end.
PascalABC 3.4.2