Var
A: array[1..100, 1..100] of integer;
B: array[1..100]of integer;
i, j, k, n, m, imax: integer;
manual: boolean;
begin
writeln('Ручной ввод (true/false)==>');
read(manual);
if manual then begin
writeln('Размер массива n, m ==>');
read(n, m);
end
else begin
n := random(10) + 5;
m := random(10) + 5;
end;
for i := 1 to n do
begin
writeln();
for j := 1 to m do
begin
if manual then
read(a[i, j])
else begin
a[i, j] := random(100) - 50;
write(a[i, j]:3, ' ');
end;
end;
end;
writeln();
writeln();
for j := 1 to m do
if j mod 2 = 1 then begin
k := k + 1;
b[k] := 1;
for i := 1 to n do
b[k] := b[k] * a[i, j];
write(b[k], ' ');
end;
writeln();
for i := 1 to k - 1 do
begin
imax := i;
for j := i + 1 to k do
if b[j] > b[imax] then
imax := j;
n := b[i];
b[i] := b[imax];
b[imax] := n;
end;
for i := 1 to k do
write(b[i], ' ');
end.