public class Class_2 {
static int jiecheng(int n){
if(n <= 1){
return 1;
}else{
return n*jiecheng(n - 1); //利用的是阶乘和递归
}
}
public static void main(String[] args) {
int zhi = jiecheng(5);
System.out.println(zhi);
}
}
数学中的阶乘
猜你喜欢
转载自blog.csdn.net/qq_30443907/article/details/82143681
今日推荐
周排行