标签:pytho bsp print else nbsp format int 汉诺塔问题 ==
def hanoi(n,a,b,c):
if n== 1:
print("{}->{}".format(a,c))
else:
hanoi(n-1,a,c,b)
print("{}->{}".format(a,c))
hanoi(n-1,b,a,c)
hanoi(5,‘A‘,‘B‘,‘C‘)
标签:pytho bsp print else nbsp format int 汉诺塔问题 ==
原文地址:http://www.cnblogs.com/didiaoxiaoguai/p/6839242.html