Текст задания:
Найти max среди всех элементов тех строк заданной матрицы, которые упорядочены по возрастанию.
program pract11_4;.
const n=3;m=3;
type mas=array[1..n,1..m] of integer;
mas2=array[1..n] of integer;
function max(n:byte;a:mas):integer;
var i,j:integer;mix:integer;
begin
mix:=a[1,j];
for i:=2 to n do
for j:=1 to m do begin
if a[i,j]>mix then mix:=a[i,j];
max:=mix;
end;
end;
var i,j:integer;k1:byte;a:mas;
begin
for i:=1 to n do
for j:=1 to m do
begin
writeln('wwedite ',i,',',j,' element matrici');
read(a[i,j]);end;
for i:=1 to n-1 do
for j:=1 to m do begin
if a[i,j]<a[i+1,j] then begin
k1:=k1+1;end;end;
if k1=n-1 then begin max(n,a);
end;
writeln('max= ',max(n,a):6);
end.