码迷,mamicode.com
首页 > 其他好文 > 详细

Uva-oj Product 大数乘法

时间:2016-03-09 20:59:27      阅读:225      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!