1)
const
n=5;
var
a:array[1..n,1..n]of integer;
i,j:integer;
begin
for i:=1 to n do
begin
writeln;
for j:=1 to n do
begin
a[i,j]:=i+j;
write(a[i,j]:4);
end;
end;
end.
2)
const
n=4;m=5;
var
a:array[1..n,1..m]of integer;
i,j,max:integer;
begin
for i:=1 to n do
begin
writeln;
for j:=1 to m do
begin
a[i,j]:=random(100)-50;
write(a[i,j]:4);
end;
end;
max:=a[1,1];
for i:=1 to n do
for j:=1 to m do
if a[i,j]>max then
max:=a[i,j];
writeln;
writeln(max);
for i:=1 to n do
for j:=1 to m do
if (a[i,j]<0)and(a[i,j]>-5)then
a[i,j]:=max;
writeln;
for i:=1 to n do
begin
writeln;
for j:=1 to m do
write(a[i,j]:4);
end;
end.