const
SzM = 10;
SzN = 10;
var
a: array[1..SzM, 1..SzN] of integer;
m, n, i, j, Count: integer;
begin
m := 3;
n := 4;
{ввод массива}
for i := 1 to m do
for j := 1 to n do
a[i, j] := (i - 1) * n + j;//если ввод вручную, тогда Read(a[i,j])
{вывод массива}
Write(a[i, j]:4);
Writeln;
end;
{подсчет четных}
if a[i, j] mod 2 = 0 then Count += 1;
Write('количество четных: ', Count)
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
const
SzM = 10;
SzN = 10;
var
a: array[1..SzM, 1..SzN] of integer;
m, n, i, j, Count: integer;
begin
m := 3;
n := 4;
{ввод массива}
for i := 1 to m do
for j := 1 to n do
a[i, j] := (i - 1) * n + j;//если ввод вручную, тогда Read(a[i,j])
{вывод массива}
for i := 1 to m do
begin
for j := 1 to n do
Write(a[i, j]:4);
Writeln;
end;
{подсчет четных}
for i := 1 to m do
for j := 1 to n do
if a[i, j] mod 2 = 0 then Count += 1;
Write('количество четных: ', Count)
end.