Var maxi,maxj,i,j,max:integer; ma:array[1..n,1..m] of integer; begin randomize; max:=integer.MinValue; writeln('Matrix:'); for i:=1 to n do begin for j:=1 to m do begin ma[i,j]:=random(100); write(ma[i,j]:4); if (i=2) and (ma[i,j]>max) then begin max:=ma[i,j]; maxi:=i; maxj:=j; end; end; writeln; end; writeln('Max=',max); writeln('Строка:',maxi); writeln('Столбец:',maxj); end.
Const
n=3;
m=4;
Var
maxi,maxj,i,j,max:integer;
ma:array[1..n,1..m] of integer;
begin
randomize;
max:=integer.MinValue;
writeln('Matrix:');
for i:=1 to n do
begin
for j:=1 to m do
begin
ma[i,j]:=random(100);
write(ma[i,j]:4);
if (i=2) and (ma[i,j]>max) then
begin
max:=ma[i,j];
maxi:=i;
maxj:=j;
end;
end;
writeln;
end;
writeln('Max=',max);
writeln('Строка:',maxi);
writeln('Столбец:',maxj);
end.