大数相乘
输入:
-12341234
43214321
输出:
-533318047612114
1、利用BigInteger
public class Main{
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner s= new Scanner(System.in);
BigInteger n = s.nextBigInteger();
BigInteger m = s.nextBigInteger();
System.out.println(n.multiply(m));
}
}
2、字符串处理方式: