Программа :
uses Crt;
const n=10;
type Vec=array [1..n] of integer ;
var i, Max: integer;
A: Vec ;
begin
ClrScr;
Randomize;
WriteLn (' Old Massiv: ');
for i:=1 to n do
begin
A[i]:=-5+random(15);
Write (A[i]:4);
end;
WriteLn;
Max:=A[1];
for i:=2 to n do
if A[i]> Max then Max:=A[i];
WriteLn;
WriteLn(' Max = ', Max);
WriteLn (' New Massiv: ');
for i:=1 to n do
begin
if A[i] >0 then A[i]:=Max;
Write (A[i]:4);
end;
WriteLn;
ReadLn;
end.