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

PROGRAMMING:Programming question 3

Luz5年前 (2021-05-10)题库521
Find the sum of diagonal elements of a (n * n) matrix.
###Input format:
Input integer n < 20 in the first row, and then input n consecutive rows, n integers in each row, representing each row of the matrix.
###Output format:
Output the sum of diagonal elements, all elements do not repeat the calculation.
###Input example:
```in
three
1 2 3
4 5 6
7 8 9
```
###Output example:
```out
twenty-five
```







answer:If there is no answer, please comment