题解 | #蛇形矩阵#
蛇形矩阵
https://www.nowcoder.com/practice/649b210ef44446e3b1cd1be6fa4cab5e
while True: try: N = int(input()) for i in range(1,N+1): for j in range(1,N-i+2): print(int(1+((i+j)**2-3*i-j)/2),end=' ') print() except: break
蛇形矩阵
https://www.nowcoder.com/practice/649b210ef44446e3b1cd1be6fa4cab5e
while True: try: N = int(input()) for i in range(1,N+1): for j in range(1,N-i+2): print(int(1+((i+j)**2-3*i-j)/2),end=' ') print() except: break
相关推荐