C#使用递归写阶乘

public int jicheng(int num) {
        if (num==0)
        {
            return 0;
        }
        if (num == 1)
        {
            return 1;
        }
        else
        {
            return num * jicheng(num-1);
        }
    }

posted on 2016-11-04 10:51  落他眉骨  阅读(2149)  评论(0)    收藏  举报

导航