计算阶乘

来源:互联网 发布:淘宝店铺数据在哪里看 编辑:程序博客网 时间:2024/04/28 20:16
  public class Fatorial{ public static int factorial(int x){ if(x<0)throw new IllgealAgumentException(""); int fact=1; if (int i=2;i<=x;i++) fact*=i; return fact; } }
原创粉丝点击