var A: array [1 .. MAX, 1 .. MAX] of integer; i, j, N, M: byte; min: integer;
begin randomize; write(' Введите N(макс. ', MAX, ') = '); readln(N); write(' Введите M(макс. ', MAX, ') = '); readln(M); writeln(' Исходная матрица: '); for i := 1 to N do begin for j := 1 to M do begin A[i, j] := random(100) - 50; write(A[i, j]:6); end; writeln; end;
for i := 1 to N do begin min := A[i, 1]; if i mod 2 = 0 then begin for j := 1 to M do if A[i, j] < min then min := A[i, j]; writeln(' Минимальный элемент ', i, ' строки = ', min); end; end;
Answers & Comments
MAX = 100;
var
A: array [1 .. MAX, 1 .. MAX] of integer;
i, j, N, M: byte;
min: integer;
begin
randomize;
write(' Введите N(макс. ', MAX, ') = ');
readln(N);
write(' Введите M(макс. ', MAX, ') = ');
readln(M);
writeln(' Исходная матрица: ');
for i := 1 to N do
begin
for j := 1 to M do
begin
A[i, j] := random(100) - 50;
write(A[i, j]:6);
end;
writeln;
end;
for i := 1 to N do
begin
min := A[i, 1];
if i mod 2 = 0 then
begin
for j := 1 to M do
if A[i, j] < min then
min := A[i, j];
writeln(' Минимальный элемент ', i, ' строки = ', min);
end;
end;
end.