java大数类,两个不超过20位都不为0的十进制字符串相乘,华为笔试题

import java.math.BigInteger;
import java.util.*;
import java.io.*;
public  class Main
{
    public static void main(String args[])
    {
        Scanner in=new Scanner(System.in);
        BigInteger a=in.nextBigInteger();
        BigInteger b=in.nextBigInteger();
        BigInteger ans=a.multiply(b);
        System.out.println(ans);
    }

}
View Code

 

posted @ 2018-09-12 20:49  JarvisLau  阅读(251)  评论(0编辑  收藏  举报