Const n=4; m=5;
var
a:array[1..n,1..m] of integer;
i,j,k:integer;
begin
Randomize;
writeln('Исходный массив:');
for i:=1 to n do
begin
for j:=1 to m do
begin
a[i,j]:=random(90)+10;
if a[i,j] mod 2 = 0 then a[i,j]:=a[i,j]+1;
write(a[i,j]:4);
end;
writeln;
end;
k:=0;
for i:=1 to n do
for j:=1 to m do
if (a[i,j] div 10 + a[i,j] mod 10) = 7 then k:=k+1;
writeln('k = ',k);
end.
Пример:
Исходный массив:
79 47 11 63 31
85 73 97 79 35
99 49 43 55 61
93 75 41 33 45
k = 2