题解 | #尼科彻斯定理#
尼科彻斯定理
http://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
def sunmNumber(n): L1=[] L2 =[] L3=[] if n ==1: return print(1) else: for i in range(1,n**3,2): L1.append(i) #print(L1)
for j in range(len(L1)):
L2=L1[j:j+n]
#print(L2)
if sum(L2)==n**3:
L3=L1[j:j + n]
#print(L3)
return print(' '.join(str(x) for x in L3))
while True: try: n = int(input()) s =sunmNumber(n) except: break