题解 | #蛇形矩阵#
蛇形矩阵
https://www.nowcoder.com/practice/649b210ef44446e3b1cd1be6fa4cab5e
num = int(input()) l = [1] for i in range(2, num + 1): l.append(l[i - 2] + i) print(" ".join(list(map(str, l)))) for j in l: l.pop(0) l = list(map(lambda x: x - 1, l)) print(" ".join(list(map(str, l))))