На паскаль:
var
a: array [1..10] of integer;
max, min, i: integer;
begin
for i := 1 to 10 do
read(a[i]);
max:=-maxint;
min:= maxint;
for i:= 1 to 10 do
if (a[i]>max) then max:=a[i];
for i := 1 to 10 do
if (a[i]for i := 1 to 10 do
if (a[i]<0) then a[i] := min else if (a[i]>0) then a[i]:=max;
for i := 1 to 10 do
write(a[i],' ');
readln;
readln;
end.