========== 汉诺塔 ========
def hanta(n,x,y,z):
if n == 1:
print(x ,'->', z)
else:
hanta(n-1,x,z,y)
print(x ,'->', z)
hanta(n-1,y,x,z)
i = int(input('请输入整数:'))
hanta(i,'一柱','二柱','三柱')
def hanta(n,x,y,z):
if n == 1:
print(x ,'->', z)
else:
hanta(n-1,x,z,y)
print(x ,'->', z)
hanta(n-1,y,x,z)
i = int(input('请输入整数:'))
hanta(i,'一柱','二柱','三柱')