Var ar:array[1..30] of integer;
i,max,max2,maxp,maxi:integer;
begin;
randomize;
writeln('Array');
for i:=1 to 30 do
begin;
ar[i]:=random(1,100);
write(ar[i]:4);
end;
for i:=1 to 30 do
if maxbegin;
maxp:=max;
max:=ar[i];
maxi:=i;
end;
ar[maxi]:=maxp;
for i:=1 to 30 do
if max2writeln;
writeln('Max1:',max);
writeln('Max2:',max2);
end.