题解 | #蛇形矩阵#
蛇形矩阵
https://www.nowcoder.com/practice/649b210ef44446e3b1cd1be6fa4cab5e
N = int(input()) list1 = [[1,]] for i in range(0,N-1): list1.append([0]) for i in range(1,N): list1[i][0] = list1[i-1][0] + i for i in range(0,N): for j in range(1,N-i): list1[i].append(list1[i][j-1] + i + j + 1) for i in range(0,N): for j in range(0,N-i): print(list1[i][j],end=' ') print('')