L=[] def fib2(n): if n in L: return L[n] if(n==0): return 0 if(n==1): return 1 res = fib2(n - 1) + fib2(n - 2) L[n] = res return res print(fib2(5))
JayD
有心寻性
相关分类