Ответ:
var a:array [1..6,1..8] of integer;
i,j,mi,mj:integer;
begin
writeln('Массив: ');
for i:=1 to 6 do
for j:=1 to 8 do
a[i,j]:=random(90)+10;
write(a[i,j]:4)
end;
writeln
writeln;
mi:=1;
mj:=1;
if a[i,j] > a[mi,mj] then
mi:=i;
mj:=j
end
writeln ('max[',mi,',',mj,'] = ',a[mi,mj]);
if (i=mi) or (j=mj) then a[i,j]:=0;
end.
===== PascalABC.NET =====
var (m, n) := (6, 8);
var a := MatrRandom(m, n, -99, 99);
a.Println(4);
Writeln;
var t := a.ElementsWithIndices.MaxBy(p -> p[0]);
a.SetRow(t[1], ArrFill(n, 0));
a.SetCol(t[2], ArrFill(m, 0));
a.Println(4)
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
var a:array [1..6,1..8] of integer;
i,j,mi,mj:integer;
begin
writeln('Массив: ');
for i:=1 to 6 do
begin
for j:=1 to 8 do
begin
a[i,j]:=random(90)+10;
write(a[i,j]:4)
end;
writeln
end;
writeln;
mi:=1;
mj:=1;
for i:=1 to 6 do
begin
for j:=1 to 8 do
if a[i,j] > a[mi,mj] then
begin
mi:=i;
mj:=j
end
end;
writeln ('max[',mi,',',mj,'] = ',a[mi,mj]);
writeln;
writeln('Массив: ');
for i:=1 to 6 do
begin
for j:=1 to 8 do
begin
if (i=mi) or (j=mj) then a[i,j]:=0;
write(a[i,j]:4)
end;
writeln
end
end.
===== PascalABC.NET =====
begin
var (m, n) := (6, 8);
var a := MatrRandom(m, n, -99, 99);
a.Println(4);
Writeln;
var t := a.ElementsWithIndices.MaxBy(p -> p[0]);
a.SetRow(t[1], ArrFill(n, 0));
a.SetCol(t[2], ArrFill(m, 0));
a.Println(4)
end.