P1303_A*B Problem(JAVA语言)

思路:BigInteger 三杀!

//四行搞定

题目描述

求两数的积。

输入输出格式

输入格式:

 

两行,两个数。

 

输出格式:

 

 

输入输出样例

输入样例#1: 复制

1 
2

输出样例#1: 复制

2

说明

每个数字不超过10^2000,需用高精

import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in=new Scanner(System.in);
		BigInteger a=in.nextBigInteger();
		BigInteger b=in.nextBigInteger();
		System.out.println(a.multiply(b));
	}

}

 

posted @ 2019-05-06 10:31  挖掘机斯基  阅读(60)  评论(0)    收藏  举报