51Nod 1005 大数加法
2017-11-18 15:59
190 查看
题意:给出2个大整数A,B,计算A+B的结果。
解题思路:本想用C++写,后来觉得太麻烦就用Java写了一个,用Java写大整数比较方便
代码:
import java.util.*;
import java.math.*;
public class Test {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
BigInteger big1 = scan.nextBigInteger();
BigInteger big2 = scan.nextBigInteger();
BigInteger x=big1.add(big2);
System.out.println(x);
}
}
解题思路:本想用C++写,后来觉得太麻烦就用Java写了一个,用Java写大整数比较方便
代码:
import java.util.*;
import java.math.*;
public class Test {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
BigInteger big1 = scan.nextBigInteger();
BigInteger big2 = scan.nextBigInteger();
BigInteger x=big1.add(big2);
System.out.println(x);
}
}
相关文章推荐
- 51nod 1005 大数加法
- 51nod 1005 大数加法
- 51Nod 1005 大数加法
- 51nod——1005 大数加法
- 51nod 1005 大数加法
- 51nod 1005 大数加法
- 【51Nod】1005 大数加法
- 51Nod - 1005 大数加法
- 51nod 1005 大数加法
- 51Nod-1005-大数加法
- 51Nod 1005 大数加法
- 51nod-1005 大数加法
- 【51nod】1005 大数加法
- 51nod 1005 大数加法(可为负数)
- 51nod_1005 大数加法
- 大数高精度加减乘除 51nod 1005 大数加法
- 51Nod-1005-大数加法
- 51Nod-1005 大数加法
- 51Nod-1005-大数加法
- 51nod 1005 大数加法