题解 | #蛇形矩阵#
蛇形矩阵
http://www.nowcoder.com/practice/649b210ef44446e3b1cd1be6fa4cab5e
while True:
try:
a = int(input())
res = []
for i in range(a):
if i == 0:
res = [(j+2)*(j+1)//2 for j in range(a)]
else:
res = [z-1 for z in res[1:]]
print(' '.join(map(str,res)))
except:
break