При использовании random() упорядоченные строки получаются редко. Можете массив вводить с клавиатуры.const n=5; m=4;var a:array[1..n,1..m] of integer;i,j,max:integer;b1,b2:boolean;beginRandomize;writeln('Исходный массив:');for i:=1 to n do begin for j:=1 to m do begin a[i,j]:=random(100); write(a[i,j]:4); end; writeln; end;max:=-1000;for i:=1 to n do begin b1:=true; b2:=true; for j:=1 to m-1 do begin if a[i,j]<a[i,j+1] then b1:=false; if a[i,j]>a[i,j+1] then b2:=false; end; if b1 or b2 then for j:=1 to m do if a[i,j]>max then max:=a[i,j]; end;if max<>-1000 then writeln('max = ',max) else writeln('В массиве нет упорядоченных строк');end.Пример: 45 34 88 53
2 7 36 71
48 57 28 42
75 61 10 93
15 3 61 54
max = 71