LeetCode刷题第八九十周
509、斐波那契数https://img2023.cnblogs.com/blog/3018498/202212/3018498-20221227223347069-1934751516.png
class Solution { public int fib(int n) { // 方法一:递归 // if(n==0){ // return 0; // }else if(n==1){ // return 1; // }else{ // return fib(n-1)+fib(n-2); // } // 方法二:动态规划 if(n
页:
[1]