PROGRAMMING:Conditional summation of two dimensional array elements
Given a two-dimensional array of M rows and N columns, please count how many elements in the two-dimensional array meet the following conditions:
The value of the element is exactly equal to the sum of the values of the elements in the eight directions directly adjacent to it. Ignored if the array boundary is exceeded.
###Input format:
First, enter m and N to represent the number of rows and columns of the two-dimensional matrix, 5 < = m, n < = 100
Then enter m for each line, n positive integers for each line, separated by spaces.
###Output format:
Output the number of elements that meet the conditions. After outputting the data, you need to output carriage return and line feed.
###Input example:
Here is a set of inputs. For example:
```in
5 5
0 1 1 1 1
1 1 1 1 1
1 1 8 1 1
1 1 1 1 1
1 1 1 1 3
```
###Output example:
The corresponding output is given here. In the example, only 8 and 3 satisfy the conditions, so a total of 2 satisfy the conditions. For example:
```out
two
```
answer:If there is no answer, please comment
The value of the element is exactly equal to the sum of the values of the elements in the eight directions directly adjacent to it. Ignored if the array boundary is exceeded.
###Input format:
First, enter m and N to represent the number of rows and columns of the two-dimensional matrix, 5 < = m, n < = 100
Then enter m for each line, n positive integers for each line, separated by spaces.
###Output format:
Output the number of elements that meet the conditions. After outputting the data, you need to output carriage return and line feed.
###Input example:
Here is a set of inputs. For example:
```in
5 5
0 1 1 1 1
1 1 1 1 1
1 1 8 1 1
1 1 1 1 1
1 1 1 1 3
```
###Output example:
The corresponding output is given here. In the example, only 8 and 3 satisfy the conditions, so a total of 2 satisfy the conditions. For example:
```out
two
```
answer:If there is no answer, please comment