UVA10106 Product【大数乘法】

The problem is to multiply two integers X, Y . (0 ≤ X, Y < 10^250)
Input
The input will consist of a set of pairs of lines. Each line in pair contains one multiplyer.
Output
For each input pair of lines the output line should consist one integer the product.
Sample Input
12
12
2
222222222222222222222222
Sample Output
144
444444444444444444444444

问题链接UVA10106 Product
问题简述:(略)
问题分析
    大数计算还是用Java比较计算。这是一个大数乘法问题。
程序说明:(略)
参考链接:(略)
题记:(略)

AC的Java语言程序如下:

/* UVA10106 Product */

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static Scanner s = new Scanner(System.in);

    public static void main(String args[]) throws Exception {
    Scanner in = new Scanner(System.in);
    while(in.hasNext()) {
            BigInteger a = in.nextBigInteger();
            BigInteger b = in.nextBigInteger();
            System.out.println(a.multiply(b));
    }
    }
}

猜你喜欢

转载自www.cnblogs.com/tigerisland45/p/10389594.html
今日推荐