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