标签:acm java biginteger 大数类
1 2 3
1 2 6求10000以内的阶乘。java+暴力。。。import java.io.*; import java.util.*; import java.math.*; public class Main { public static void main(String[] args){ Scanner in=new Scanner(System.in); int n,i;BigInteger ans,t; while(in.hasNext()){ n=in.nextInt(); ans=new BigInteger("1"); for(i=1;i<=n;i++){ t=new BigInteger(Integer.toString(i)); ans=ans.multiply(t); } System.out.println(ans); } } }
标签:acm java biginteger 大数类
原文地址:http://blog.csdn.net/qq_16255321/article/details/39299583