美文网首页
大数java复习

大数java复习

作者: 黑夜里不灭的路灯 | 来源:发表于2019-03-23 23:07 被阅读0次
    package test;
    import java.io.*;
    import java.math.BigDecimal;
    import java.math.BigInteger;
    import java.util.*;
    public class Test {
    
        public static void main(String[] args) {
            // TODO Auto-generated method stub
            
             int num[]= {5650 ,4542 ,3554, 473 ,946, 4114 ,3871, 9073 ,90, 4329 ,
                        2758 ,7949 ,6113, 5659 ,5245, 7432, 3051, 4434, 6704 ,3594, 
                        9937 ,1173 ,6866 ,3397, 4759, 7557 ,3070 ,2287 ,1453, 9899 ,
                        1486 ,5722 ,3135 ,1170, 4014 ,5510, 5120, 729,2880, 9019 ,
                        2049 ,698, 4582, 4346, 4427, 646 ,9742 ,7340 ,1230, 7683 ,
                        5693, 7015, 6887, 7381, 4172, 4341, 2909, 2027, 7355, 5649 ,
                        6701, 6645, 1671, 5978 ,2704, 9926, 295, 3125, 3878, 6785 ,
                        2066 ,4247, 4800 ,1578, 6652, 4616, 1113 ,6205, 3264, 2915 ,
                        3966, 5291, 2904, 1285, 2193, 1428 ,2265 ,8730, 9436, 7074 ,
                        689 ,5510 ,8243, 6114, 337, 4096, 8199, 7313 ,3685, 211};
             BigInteger sum,tmp;
             sum=BigInteger.valueOf(1);
             
             for(int i=0;i<num.length;i++)
             {
                 tmp=BigInteger.valueOf(num[i]);
                 sum=sum.multiply(tmp);
             }
             System.out.println(sum);
        }
    }
    
    

    112142221918653666702449201125076321480831896827506427440731023870278025729017605653056978504625081950967446934475613782859722081655293509714201067451491601144000940085173776751705443818861349991600968912829674368417898694508188364854988187881792613763161458365648071883922054736261940944120399031297726871056069331318210560000000000000000000000000000000

    相关文章

      网友评论

          本文标题:大数java复习

          本文链接:https://www.haomeiwen.com/subject/thaevqtx.html