Uva-oj Product 大数乘法
Posted 半根毛线code
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Uva-oj Product 大数乘法相关的知识,希望对你有一定的参考价值。
Description
The problem is to multiply two integers X, Y. (0<=X,Y<10250)
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
大数乘法 java大法好
1 import java.math.BigInteger; 2 import java.util.Scanner; 3 class Main 4 { 5 public static void main(String[] args) 6 { 7 BigInteger[] a=new BigInteger[5]; 8 Scanner input = new Scanner(System.in); 9 while(input.hasNext()) 10 {a[1]= input.nextBigInteger(); 11 a[2]= input.nextBigInteger(); 12 System.out.println(a[1].multiply(a[2])); 13 } 14 } 15 }
以上是关于Uva-oj Product 大数乘法的主要内容,如果未能解决你的问题,请参考以下文章