public class Demo06 {
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);
}
}
}
标签:20,递归,int,static,return,方法,public
From: https://www.cnblogs.com/PedroPascal/p/17095085.html