您的位置:首页 > 其它

华为笔试——第三题 大数相乘

2018-03-22 10:08 344 查看
大数相乘

输入:

-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、字符串处理方式:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: