Begin var a: array [,] of integer := ( (1, 10, 100), (1, 10, 200), (1, 9, 100), (1, 9, 100));
var max := integer.MinValue; var countmax := 0; var min := integer.MaxValue; var countmin := 0; var counter := 0; for var j := 0 to a.GetLength(1) - 1 do begin counter += 1; var c := 0; for var i := 0 to a.GetLength(0) - 1 do begin c += a[i, j] end; if max < c then begin max := c; countmax := counter; end; if min > c then begin min := c; countmin := counter; end; end; writeln('Столбик с наибольшей суммой - ', countmax); writeln('Столбик с наименьшей суммой - ', countmin); end.
var a: array [,] of integer := (
(1, 10, 100),
(1, 10, 200),
(1, 9, 100),
(1, 9, 100));
var max := integer.MinValue;
var countmax := 0;
var min := integer.MaxValue;
var countmin := 0;
var counter := 0;
for var j := 0 to a.GetLength(1) - 1 do
begin
counter += 1;
var c := 0;
for var i := 0 to a.GetLength(0) - 1 do
begin
c += a[i, j]
end;
if max < c then
begin
max := c;
countmax := counter;
end;
if min > c then
begin
min := c;
countmin := counter;
end;
end;
writeln('Столбик с наибольшей суммой - ', countmax);
writeln('Столбик с наименьшей суммой - ', countmin);
end.