标签:input lse color count mat col global div span
count = 0 def hanoi(n, src, dst, mid): global count if n == 1: print("{}:{}->{}".format(1,src,dst)) count += 1 else : hanoi(n-1, src, mid, dst) print("{}:{}->{}".format(n,src,dst)) count += 1 hanoi(n-1, mid, dst, src) hanoi(eval(input()),"A","C","B") print(count)
标签:input lse color count mat col global div span
原文地址:https://www.cnblogs.com/dongyichen/p/12700765.html