Var ar:array of integer; n,max,maxi,i:integer; begin; randomize; readln(n); setlength(ar,n+1); writeln('First array:'); for i:=1 to n do begin; ar[i]:=random(100); write(ar[i]:4); if ar[i]>max then begin; max:=ar[i]; maxi:=i; end; end; ar[maxi]:=0; writeln; writeln('Final array:'); for i:=1 to n do write(ar[i]:4); end.
n,max,maxi,i:integer;
begin;
randomize;
readln(n);
setlength(ar,n+1);
writeln('First array:');
for i:=1 to n do
begin;
ar[i]:=random(100);
write(ar[i]:4);
if ar[i]>max then
begin;
max:=ar[i];
maxi:=i;
end;
end;
ar[maxi]:=0;
writeln;
writeln('Final array:');
for i:=1 to n do
write(ar[i]:4);
end.