题解 | #蛇形矩阵#
蛇形矩阵
http://www.nowcoder.com/practice/649b210ef44446e3b1cd1be6fa4cab5e
# s = list(map(int, input().split())) while True: try: input_res = int(input()) x = 1 y = input_res for i in range(input_res): x = x + i print(x, end=' ') z = x for n in range(y-1): z = z + (n+i+2) if n == y-2: print(z) else: print(z, end=' ') y = y - 1 except EOFError: break