15_递归

01_递归

  1. 求n!
public static int f(int n){
    if(n==1){
        return 1;
    }else{
        return n*f(n-1);
    }
}
posted @ 2024-07-01 22:16  神莹  阅读(24)  评论(0)    收藏  举报