1238: (2025)实验3-2 矩阵运算

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:770 Solved:215

Description

对于输入的m行m列的整数矩阵(二维数组),计算矩阵主对角线元素之和,并将矩阵转置(即行列互换)输出。其中m<10。

Sample Input Copy

3
1 2 3
4 5 6
7 8 9

Sample Output Copy

15
1 4 7
2 5 8
3 6 9