Product
The Problem
The problem is to multiply two integers X, Y. (0<=X,Y<10250)
The Input
The input will consist of a set of pairs of lines. Each line in pair contains one multiplyer.
The 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
题意:算大乘法。
思路:感觉这类的东西用java的高精度so easy!!【可能是作死
虽然JAVA比较慢,但是JAVA的高精度真的很赞。
JAVA AC代码如下:
import java.math.BigInteger;
import java.util.Scanner;
public class Main
{ public static void main(String [] args)
{ Scanner scan=new Scanner(System.in);
while(scan.hasNextBigInteger())
{ BigInteger a=scan.nextBigInteger();
BigInteger b=scan.nextBigInteger();
BigInteger c=b.multiply(a);
System.out.println(c);
}
}
}