123jgh

导航

 
public class Demo05 {
//递归思想(调用自身),数量大的话,不用这个
public static void main(String[] args) {
System.out.println(f(5));
}

public static int f(int n){
if (n==1){
return 1;
}else {
return n*f(n-1);
}
}
}
posted on 2022-10-12 16:33  江江要努力  阅读(22)  评论(0)    收藏  举报