Bull Math

来源:互联网 发布:大数据java开发工程师 编辑:程序博客网 时间:2024/05/21 06:41

Bull Math

 

Crawling in process...Crawling failedTime Limit:1000MSMemory Limit:65536KB 64bit IO Format:%I64d & %I64u

Description

Bulls are so much better at math than the cows. They can multiply huge integers together and get perfectly precise answers ... or so they say. Farmer John wonders if their answers are correct. Help him check the bulls' answers. Read in two positive integers (no more than 40 digits each) and compute their product. Output it as a normal number (with no extra leading zeros).

FJ asks that you do this yourself; don't use a special library function for the multiplication.

Input

* Lines 1..2: Each line contains a single decimal number.

Output

* Line 1: The exact product of the two input lines

Sample Input

111111111111111111111111

Sample Output

12345679011110987654321
汗~~~用java这么简单.....
java大数操作:http://blog.csdn.net/flqbestboy/article/details/7855141
import java.util.Scanner;import java.math.BigInteger;public class Main {public static void main(String[] args) {// TODO Auto-generated method stub          Scanner sc=new Scanner(System.in);          BigInteger a=sc.nextBigInteger();          BigInteger b=sc.nextBigInteger();          System.out.println(a.multiply(b));}}