public static int jiecheng(int n){ //计算机阶乘 int m=1; if (n<0) return -1; if (n==0) return 1; if (n>0) { for (int i=1;i<=n;i++) m=m*i; } return m; }