Program gt;
var x,y:array[1..1000]of integer;
k,n,i,j,r:integer;
begin
read(n);
k:=0;
for i:=1 to n do
begin
read(x[i]);
if(x[i]<0)then begin<br>k:=k+1;
y[k]:=x[i]*2;
end;
end;
for i:=1 to k do
begin
for j:=1 to k-i do
begin
r:=y[j];
if(y[j]>y[j+1])then begin
y[j]:=y[j+1];
y[j+1]:=r;
end;
end;
end;
for i:=1 to k do
begin
write(y[i],' ');
end;
end.
это метод пузырка