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

PROGRAMMING:Diagonal summation of a matrix

Luz5年前 (2021-05-10)题库608
Enter a matrix and calculate the sum of its two diagonal elements.
### input format:
Enter the number of rows n (n does not exceed 10) and then enter n * n integers.
### output format:
### input sample:
```in
five
1 1 1 1 1
1 2 3 4 5
0 1 2 3 4
2 2 2 2 2
1 1 1 1 1
```
### output sample:
```out
sum=16
```






answer:If there is no answer, please comment