题解 | #上三角矩阵判定#
上三角矩阵判定
http://www.nowcoder.com/practice/f5a29bacfc514e5a935723857e1245e4
注意类型
n=input()
matrix_list=[]
for i in range(int(n)):
matrix_val=input().split(" ")
matrix_list.append(matrix_val)
flag=True
for i in range(int(n)):
for j in range(i):
if int(matrix_list[i][j])!=0:
flag=False
if flag:
print("YES")
else:
print("NO")