摘要:
# 汉诺塔 a = "A" b = "B" c = "C" def hano(a, b, c, n): if n == 1: print("{} --> {}".format(a, c)) if n == 2: print("{} --> {}".format(a, c)) print("{} --> {}".format(a, b... 阅读全文
摘要:
# 递归 def myAdd(a, b): c = a + b print(c) if c > 100: return return myAdd(a + 1, c) #最大递归深度是1000 myAdd(2, 3) # 功能同上递归 a = 2 b = 3 for i in range(1000): c = a + b pri... 阅读全文