直接递归

    1. public class fib(int n){
    2. if(n==0&n==1){
    3. return n
    4. }
    5. return fib(n-1) + fib(n-2)
    6. }

    备忘录