Смотри на скриншот я сделал просто не хочу чтоб форматировка текста портилась.Все работает! const n=3;m=4; var a:array [1..n,1..m] of integer; i,j,k,max:Integer; ind:array [0..1] of Integer=(1,1); begin Randomize; for i:=Low(a) to High(a) do for j:=Low(a) to High(a[1]) do a[i,j]:=Random(100); for i:=Low(a) to High(a) do begin writeln; for j:=Low(a) to High(a[1]) do write(a[i,j]:3); end; max:=a[1,1]; for i:=Low(a) to High(a) do for j:=Low(a) to High(a[1]) do if a[i,j]> max then begin max:=a[i,j]; ind[0]:=i; ind[1]:=j; end; writeln; Writeln(' Max element: ',max); Write(' Index: '); for i:=0 to 1 do write(ind[i],' '); Readln; end.
const n=3;m=4;
var a:array [1..n,1..m] of integer; i,j,k,max:Integer; ind:array [0..1] of Integer=(1,1);
begin
Randomize;
for i:=Low(a) to High(a) do
for j:=Low(a) to High(a[1]) do
a[i,j]:=Random(100);
for i:=Low(a) to High(a) do
begin
writeln;
for j:=Low(a) to High(a[1]) do
write(a[i,j]:3);
end;
max:=a[1,1];
for i:=Low(a) to High(a) do
for j:=Low(a) to High(a[1]) do
if a[i,j]> max then
begin
max:=a[i,j];
ind[0]:=i;
ind[1]:=j;
end;
writeln;
Writeln(' Max element: ',max);
Write(' Index: ');
for i:=0 to 1 do
write(ind[i],' ');
Readln;
end.