//阶乘
function k(a) {
let b = 1;
for(let i =1;i<=a;i++){
b = b*i;
}
return b;
}
// k(2);
console.log(k(3));
//斐波拉切
function k1(num){
if( num<2){
return num;
}else{
return k1(num-1)+k1(num-2)
}
}
console.log(k1(6));//8