program raf105;
const
n = 5;
var
a: array[1..n,1..n] of integer;
i,j,num,n1,n2: integer;
begin
writeln('Вводите числа столбцов матрицы по очереди');
for i:=1 to n do
writeln('Столбец ',i);
for j:=1 to n do
readln(a[i,j]);
end;
n1:= 0;
n2:= 0;
if (a[i,j] mod 2 <> 0) and (a[i,j] <> 0)
then n1:= n1+1;
if (a[i,j] mod 2 = 0) and (a[i,j] <> 0)
then n2:= n2+1;
if n1 > n2
then num:= i;
writeln('Вывод: ',num);
end.
program raf105;
const
n = 5;
var
a: array[1..n,1..n] of integer;
i,j,num,n1,n2: integer;
begin
writeln('Вводите числа столбцов матрицы по очереди');
for i:=1 to n do
begin
writeln('Столбец ',i);
for j:=1 to n do
readln(a[i,j]);
end;
for i:=1 to n do
begin
n1:= 0;
n2:= 0;
for j:=1 to n do
begin
if (a[i,j] mod 2 <> 0) and (a[i,j] <> 0)
then n1:= n1+1;
end;
for j:=1 to n do
begin
if (a[i,j] mod 2 = 0) and (a[i,j] <> 0)
then n2:= n2+1;
end;
if n1 > n2
then num:= i;
end;
writeln('Вывод: ',num);
end.
PascalABC 3.4.2