首页 > 其他 > 详细

Uva-oj Product 大数乘法

时间:2016-03-09 20:59:26      阅读:301      评论:0      收藏:0      [点我收藏+]
Product
Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu
Submit Status

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 }
View Code

 

Uva-oj Product 大数乘法

原文:http://www.cnblogs.com/hsd-/p/5259524.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!