Fibonacci数列实现

  public static int Fibonacci(int aVal)
        {
            if (aVal == 0)
            {
                return 0;
            }
            if (aVal <= 2)
            {
                return 1;
            }
            else
                return Fibonacci(aVal - 1) + Fibonacci(aVal - 2);
        }

posted @   沙耶  阅读(205)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示