1)
var a:array [1..5,1..5] of integer;
i,j,max:integer;
begin
randomize;
for i:=1 to 5 do
begin
for j:=1 to 5 do
begin
a[i,j]:=random(9)+1;
write (a[i,j]:2);
end;
writeln;
end;
max:=a[1,1];
for i:=1 to 5 do
for j:=1 to 5 do
if a[i,j]>max then max:=a[i,j];
writeln;
for i:=1 to 5 do
begin
for j:=1 to 5 do
begin
if a[i,j] mod 2 = 1 then a[i,j]:=max;
write (a[i,j]:2);
end;
writeln;
end;
end.
2)
var a1:array [1..5,1..5] of integer;
a2:array [1..5] of integer;
i,j,k,max:integer;
begin
randomize;
for i:=1 to 5 do
begin
for j:=1 to 5 do
begin
a1[i,j]:=random(9)+1;
write (a1[i,j]:2);
end;
writeln;
max:=a1[i,1];
for k:=2 to 5 do
if a1[i,k]>max then max:=a1[i,k];
a2[i]:=max;
end;
writeln;
for i:=1 to 5 do write (a2[i]:2);
end.