阶乘-递归

阶乘

一定要有边界条件

test(5);
public static int test(int i){
    if(i == 1){
        return 1;
    }else{
        return i * test(i-1);
    }
}
posted @ 2021-10-07 02:00  窃窃私语QAQ  阅读(38)  评论(0编辑  收藏  举报