标签:|| cci == var OLE console function fibonacci ret
f(1) = 1;
f(2) = 1;
f(3) = f(1) + f(2) = 2;
f(4) = f(3) + f(2) = 3;
f(5) = f(4) + f(3) = 5;
f(6) = f(5) + f(4) = 8;
f(n) = f(n-1) + f(n-2) ;
function fibonacci(n) {
if(n ==0 || n==1)
return n;
return fibonacci(n-1) + fibonacci(n-2);
}
var n_num = fibonacci(9);
console.log(n_num);
标签:|| cci == var OLE console function fibonacci ret
原文地址:https://www.cnblogs.com/jkr666666/p/10945659.html