def good_fibonacci(n):
if n<=1:
return (n,0)
else:
(a,b)=good_fibonacci(n-1)
return (a+b,a)
相关文章
- 02-14斐波拉契数列(Fibonacci) 的python实现方式
- 02-14【BZOJ】1987: Zju2672 Fibonacci Subsequence
- 02-14Algorithm --> 求阶乘末尾0的个数
- 02-14【POJ】3070 Fibonacci
- 02-14朴素贝叶斯法(naive Bayes algorithm)
- 02-14Z-Algorithm详解
- 02-14CF633H Fibonacci-ish II
- 02-14HDU3117Fibonacci Numbers(矩阵快速幂 + 数学推导)
- 02-14ssh连接报错server responded”algorithm negotiation failed”
- 02-14project euler 25 fibonacci