Ответ:
const g = 5; v = 7;
var a: array[1..g,1..v] of integer;
i,j,maxj,minj,p:integer;
begin
writeln('Массив: ');
for i:=1 to g do
begin
for j:=1 to v do
begin
a[i,j]:=random(90)+10;
write(a[i,j]:4)
end;
writeln
end;
for i:=1 to g do
begin
maxj:=1;
minj:=1;
for j:=1 to v do
begin
if a[i,j]>a[i,maxj] then maxj:=j;
if a[i,j]<a[i,minj]then minj:=j;
end;
p:=a[i,maxj];
a[i,maxj]:=a[i,minj];
a[i,minj]:=p;
end;
writeln;
writeln('Преобразованный массив: ');
for i:=1 to g do
begin
for j:=1 to v do write(a[i,j]:4);
writeln
end;
end.
Объяснение: