-->
当前位置:首页 > 题库

PROGRAMMING:Finding the sum of elements in a matrix

Luz5年前 (2021-05-10)题库356
In this paper, a matrix of $$M $$row and $$n $$column is given, and the sum of the interior elements of the matrix except the boundary elements is obtained.
Where $$M $$and $$n $$are positive integers greater than 1.
###Input format:
In the first line, enter two positive integers $$M $$and $$n $$to represent the number of rows and columns of the matrix, respectively.
After that, $$M $$lines, enter $$n $$positive integers for each line to represent the elements in the matrix.
###Output format:
Output the sum of the internal elements of the matrix in one row.
###Input example:
```in
3 3
1 2 3
4 5 6
7 8 9
```
###Output example:
```out
five
```







answer:If there is no answer, please comment