1027 大数乘法 ——51Nod

基准时间限制:1 秒 空间限制:131072 KB

给出2个大整数A,B,计算A*B的结果。

Input

第1行:大数A
第2行:大数B
(A,B的长度 <= 1000,A,B >= 0)

Output

输出A * B

Input示例

123456
234567

Output示例

28958703552

代码:

import java.util.*;
import java.math.*;

public class Main {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner in = new Scanner(System.in);
        BigInteger big1 = in.nextBigInteger();
        BigInteger big2 = in.nextBigInteger();
        System.out.println(big1.multiply(big2));
    }

}
原文地址:https://www.cnblogs.com/vocaloid01/p/9514227.html