#Z15203. 计算矩阵边缘元素之和
计算矩阵边缘元素之和
Description
Enter an integer matrix and calculate the sum of the elements located at the edges of the matrix. The edge elements of the matrix refer to the elements of the first and last rows, as well as the first and last columns.
Input Format
The first line contains the number of rows m and the number of columns n of the matrix (where m < 100 and n < 100), separated by a space.
The next m lines of input each contain n integers, with the integers separated by a space.
Output Format
Output the sum of the edge elements of the corresponding matrix.
3 3
3 4 1
3 7 1
2 0 1
15