原题链接:1027 大数乘法
基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题
给出2个大整数A,B,计算A*B的结果。
Input
第1行:大数A
第2行:大数B
(A,B的长度 <= 1000,A,B >= 0)
Output
输出A * B
Input示例
123456
234567
Output示例
28958703552
Python语言:
# 51NOD-1027 大数乘法
a = int(input())
b = int(input())
print(a * b)
Java语言:
/* 51NOD-1027 大数乘法 */
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static Scanner s = new Scanner(System.in);
public static void main(String args[]) throws Exception {
Scanner in = new Scanner(System.in);
BigInteger a = in.nextBigInteger();
BigInteger b = in.nextBigInteger();
System.out.println(a.multiply(b));
}
}