赞
踩
n = input().split()
i = 1
while True: # 行数,剩余量
if ((i**2)*2-1) <= int(n[0]) < (((i+1)**2)*2-1):
rest = int(n[0]) - ((i**2)*2-1)
break
i+=1
j = i
while j>=1:
print((i-j)*' ' + (j*2-1)*n[1])
j-=1
j+=2
while j<=i:
print((i-j)*' ' + (j*2-1)*n[1])
j+=1
print(rest)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。