标签:int == lse src http 汉诺塔 def else 递归
def hanoi(n,a,b,c): if n==1: print(n,a+‘->‘+c) else: hanoi(n-1,a,c,b) print(n,a+‘->‘+c) hanoi(n-1,b,a,c) hanoi(9,‘A‘,‘B‘,‘C‘)
递归,汉诺塔游戏
原文地址:https://www.cnblogs.com/rouxi/p/9180506.html