在学习中写过的那些优秀的、有意思的小项目集合
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

12 lines
290 B

let ve = 0;
const Fibonacci_Recursion = (n: number): number => {
if (n <= 0) return 0;
if (n === 1) return n;
++ve;
if (ve >= 2000) throw new Error(`层级过深: ${ve}`);
return Fibonacci_Recursion(n - 1) + Fibonacci_Recursion(n - 2);
};
console.log(Fibonacci_Recursion(80));