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

PROGRAMMING:The sum of some elements of matrix

Luz5年前 (2021-05-10)题库475
Program input integer n (1 < n < 10), and then input n * n integers (n-order matrix) in order to store in a two-dimensional array of N rows and N columns. It is required to output the sum of the upper triangular elements and the lower triangular elements of the matrix (the main diagonal belongs to the common elements of the upper and lower triangles).
###Input example:
```in
three
1 2 3
4 5 6
7 8 9
```
###Output example:
```out
26 34
```
###Input example:
```in
three
1 2 3
4 5 6
7 8 9
```
###Output example:
```out
26 34
```







answer:If there is no answer, please comment