package 递归;
public class Test {
public static void main(String[] args) {
System.out.println( jiech(5) );
}
//求n的阶乘
public static int jiech(int n){
//1的阶乘是1
if(n == 1){
return 1;
}
//n的阶乘等于n*(n-1的阶乘)
return n*jiech(n-1);
}
}