const
L = 1;
H = 5;
var
b: array [L..H, L..H] of Integer;
i, j, imax, jmax, bmax: Integer;
begin
Randomize;
for i := L to H do begin
WriteLn;
for j := L to H do begin
b [i, j] := Random (100);
Write (b [i, j] :4);
end;
imax := 1;
jmax := 1;
if b [i, j] > b [imax, jmax] then begin
imax := i;
jmax := j;
Writeln ('Максимальный элемент: b [', imax, ', ', jmax, '] = ', b [imax, jmax]);
ReadLn;
end.
PascalABC.NET
var B := MatrRandom(5, 5, -99, 99);
B.Println(4);
var t := B.ElementsWithIndices.MaxBy(p -> p[0]);
Writeln('Максимальный элемент B[',
t[1] + 1, ',', t[2] + 1, '] = ', t[0])
const
L = 1;
H = 5;
var
b: array [L..H, L..H] of Integer;
i, j, imax, jmax, bmax: Integer;
begin
Randomize;
for i := L to H do begin
WriteLn;
for j := L to H do begin
b [i, j] := Random (100);
Write (b [i, j] :4);
end;
end;
imax := 1;
jmax := 1;
for i := L to H do begin
for j := L to H do begin
if b [i, j] > b [imax, jmax] then begin
imax := i;
jmax := j;
end;
end;
end;
WriteLn;
Writeln ('Максимальный элемент: b [', imax, ', ', jmax, '] = ', b [imax, jmax]);
ReadLn;
end.
PascalABC.NET
begin
var B := MatrRandom(5, 5, -99, 99);
B.Println(4);
var t := B.ElementsWithIndices.MaxBy(p -> p[0]);
Writeln('Максимальный элемент B[',
t[1] + 1, ',', t[2] + 1, '] = ', t[0])
end.