1946: 大数相乘(中等)
作者:互联网
题目描述
描述:
请计算两个正整数a,b的乘积
输入:
a b
两个数之间有空格
数据范围
简单1<=a,b<=10^500
中等1<=a,b<=10^200000
困难1<=a,b<=10^1000000
输出:
两个数的乘积
输入样例:
1 2
输出样例:
2
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
BigInteger a = cin.nextBigInteger();
BigInteger b = cin.nextBigInteger();
System.out.println(a.multiply(b));
}
}
标签:BigInteger,Scanner,大数,1946,cin,System,相乘,import,public 来源: https://blog.csdn.net/qq_43015730/article/details/90442911