C#递归算法

public static int fun(int i)
{
    if (i<=0)
    {
        return 0;
    }
    else if (i>0&&i<=2)
    {
        return 1;
    }
    else
    {
        return fun(i - 1) + fun(i - 2);
    }
}

//直接调用fun(8)

       
原文地址:https://www.cnblogs.com/AlexOneBlogs/p/8386269.html