带有记忆的菲波那切数列

    public static int Fib(int n)
    {
        int q=0;
        int []r=new int[n+1];
        r[0]=1;
        r[1]=1;
        for(int j=2;j<=n;j++)
        {
            r[j]=r[j-1]+r[j-2];
        }
        return r[n];
    }
原文地址:https://www.cnblogs.com/liuhg/p/Fib.html