题解 | #蛇形矩阵#
蛇形矩阵
https://www.nowcoder.com/practice/649b210ef44446e3b1cd1be6fa4cab5e
from re import M n=int(input()) l=[] m=1 for i in range(1,n+1): l.append([]) for x in range(1,i+1): a=i-x l[int(a)].append(m) m+=1 for i in range(n): for x in range(n-i-1): print(l[i][x],end=" ") print(l[i][-1])