直接上代码
/**
* @author n的阶乘
* @created 2019-01-08 15:38
* @description
*/
public class DemoFirst {
private static Integer res = 1;
public static Integer multe(Integer n){
if(n < 0){
return null;
}
if(n == 1 || n == 0){
return res;
}
res = res * n;
return multe(n-1);
}
public static void main(String[] args) {
Integer res = multe(-1);
System.out.println(res);
}
}