begin
var n := ReadInteger('n =');
var a := ArrRandom(n, -99, 99);
a.Println;
var b := a.Where(p -> p > 0).Sorted.ToArray;
if b.Length > 0 then
var j := 0;
for var i := 0 to a.High do
if a[i] > 0 then begin
a[i] := b[j];
j += 1
end
else
a[i] := 0
end;
a.Println
end.
begin
var n := ReadInteger('n =');
var a := ArrRandom(n, -99, 99);
a.Println;
var b := a.Where(p -> p > 0).Sorted.ToArray;
if b.Length > 0 then
begin
var j := 0;
for var i := 0 to a.High do
if a[i] > 0 then begin
a[i] := b[j];
j += 1
end
else
a[i] := 0
end;
a.Println
end.