const NN=30;
var
b:array[1..NN] of integer;
i,j,k,l,n:integer;
begin
randomize;
writeln('B:');
for i:=1 to NN do begin
b[i]:=random(101)-50;
write(b[i]:4);
end;
writeln;
write('n,k=');readln(n,k);
for i:=1 to NN-1 do
for j:=i+1 to NN do
if (i>=n) and (i<=k) and (j>=n) and (j<=k) and (b[i]>b[j]) then begin
l:=b[i];
b[i]:=b[j];
b[j]:=l;
end;
writeln('B_new:');
for i:=1 to NN do write(b[i]:4);
var
b:array[1..NN] of integer;
i,j,k,l,n:integer;
begin
randomize;
writeln('B:');
for i:=1 to NN do begin
b[i]:=random(101)-50;
write(b[i]:4);
end;
writeln;
write('n,k=');readln(n,k);
for i:=1 to NN-1 do
for j:=i+1 to NN do
if (i>=n) and (i<=k) and (j>=n) and (j<=k) and (b[i]>b[j]) then begin
l:=b[i];
b[i]:=b[j];
b[j]:=l;
end;
writeln('B_new:');
for i:=1 to NN do write(b[i]:4);
end.