摘要: 参考实现 # 递归 -汉诺塔 def hanoi(n, a, b, c): if n > 0: hanoi(n - 1, a, c, b) print(f'moving from {a} --> {c}') hanoi(n - 1, b, a, c) hanoi(3, 'A', 'B', 'C') 阅读全文
posted @ 2023-05-19 22:36 晓枫的春天 阅读(16) 评论(0) 推荐(0) 编辑