Var ma:array[1..n,1..n] of integer; i,j,max,maxi,maxj:integer; begin randomize; max:=-1; writeln('Matrix:'); for i:=1 to n do begin for j:=1 to n do begin ma[i,j]:=random(1000); write(ma[i,j]:4); if max<ma[i,j] then begin max:=ma[i,j]; maxi:=i; maxj:=j; end; end; writeln; end; writeln('Max=',max); writeln('Строка:',maxi); write('Столбец:',maxj); end.
Answers & Comments
Verified answer
//Pascal ABC.NET сборка 1256Const
n=7;
Var
ma:array[1..n,1..n] of integer;
i,j,max,maxi,maxj:integer;
begin
randomize;
max:=-1;
writeln('Matrix:');
for i:=1 to n do
begin
for j:=1 to n do
begin
ma[i,j]:=random(1000);
write(ma[i,j]:4);
if max<ma[i,j] then
begin
max:=ma[i,j];
maxi:=i;
maxj:=j;
end;
end;
writeln;
end;
writeln('Max=',max);
writeln('Строка:',maxi);
write('Столбец:',maxj);
end.