汉诺塔问题 题目答案详细思路 题目 答案 def hanoi(n, x, y, z): global step if n==0: return hanoi(n-1,x,z,y) print("{} -> {}".format(x,z)) step += 1 hanoi(n-1,y,x,z) 详细思路 想了解汉诺塔函数的详细思路的同学可以点击下方的链接跳转到我的另一篇文章,里面有比较简洁清晰的讲解供大家参考 https://blog.csdn.net/ljhsq/article/details/115302974