import numpy as np n=int(input())
R = n C = n p,s=0,0
print("Enter the entries in a single line (separated by space): ")
entries = list(map(int, input().split())) matrix = np.array(entries).reshape(R, C) print(matrix) for i in range(R): for j in range(C): if i==j: p=p+matrix[i][j] if i+j==n-1: s=s+matrix[i][j] s1=p-s print(s1)
7条答案
按热度按时间axkjgtzd1#
使用数组概念的#pyhton3
f8rj6qna2#
也许这会有所帮助:
ds97pgxw3#
atmip9wb4#
包含
使用命名空间std;
jq6vz3qz5#
pxq42qpu6#
时间复杂度O(n)
rnmwe5a27#