1 BigDecimal count = new BigDecimal(0); 2 for (int i = 1; i <= 1000; i++) { 3 BigDecimal mutil = new BigDecimal(1); 4 for (int j = 1; j <= i; j++) { 5 mutil = mutil.multiply(new BigDecimal(j)); 6 } 7 count = count.add(mutil); 8 } 9 System.out.println("值:" + count.toString());
原文:http://www.cnblogs.com/lavalike/p/5555207.html