java大数阶乘

来源:互联网 发布:淘宝店铺怎么从新激活 编辑:程序博客网 时间:2024/06/07 03:16
import java.math.*;public class teset{   public static void main(String[]args){      jiecheng(45);}public static void jiecheng(int n){   String b;    BigInteger c = new BigInteger("1");for(int i=1;i<=n;i++){         b=Integer.toString(i);         BigInteger t=new BigInteger(b);         c=c.multiply(t);}System.out.print(c);}}


0 0
原创粉丝点击