Const N = 10;Const M = 10;Var A:Array [1..N, 1..M] Of Integer; i, j, imax, jmax, imin, jmin, temp:Integer; Begin randomize; For i := 1 to N do Begin For j := 1 to M do Begin A[i, j] := random(1000); End; End; imin := 1; imax := 1; jmin := 1; jmax := 1; For i := 1 to N do Begin For j := 1 to M do Begin If A[i, j] > A[imax, jmax] then Begin imax := i; jmax := j; End; If A[i, j] < A[imin, jmin] then Begin imin := i; jmin := j; End; End; End; writeln('first elem: ', A[imax, jmax], ', second elem: ', A[imin, jmin]); temp := A[imin, jmin]; A[imin, jmin] := A[imax, jmax]; A[imax, jmax] := temp; writeln('first elem: ', A[imax, jmax], ', second elem: ', A[imin, jmin]);End.
Const N = 5; var i, j: integer; a: array[1..N, 1..N] of integer; min, max: array[1..N] of integer; begin writeln('Исходный массив: '); for i := 1 to N do begin for j := 1 to N do begin a[i, j] := Random(10); write(a[i, j] : 3); if (j = 1) or (max[i] > a[i, j]) then max[i] := a[i, j]; if (i = 1) or (min[j] < a[i, j]) then min[j] := a[i, j]; end; writeln; end; writeln('Седловые точки: '); for i := 1 to N do for j := 1 to N do if max[i] = min[j] then writeln('[', i, '; ', j, ']'); end.
N = 5;
var
i, j: integer;
a: array[1..N, 1..N] of integer;
min, max: array[1..N] of integer;
begin
writeln('Исходный массив: ');
for i := 1 to N do begin
for j := 1 to N do begin
a[i, j] := Random(10);
write(a[i, j] : 3);
if (j = 1) or (max[i] > a[i, j]) then max[i] := a[i, j];
if (i = 1) or (min[j] < a[i, j]) then min[j] := a[i, j];
end;
writeln;
end;
writeln('Седловые точки: ');
for i := 1 to N do
for j := 1 to N do
if max[i] = min[j] then writeln('[', i, '; ', j, ']');
end.