1,1,2,3,5,8,13,21..... 求第n个数的值
function febonacci(n){
var num1 = 1,
num2 = 1,
sum;
if(n===1||n===2){
return 1;
}
for(var i=2;i<n;i++){
sum = num1 + num2;
num1 = num2;
num2 = sum;
}
return sum;
}