51 Nod 1005 大数加法【Java大数乱搞,python大数乱搞】
2017-07-25 17:55
471 查看
1005 大数加法
基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题
给出2个大整数A,B,计算A+B的结果。
Input
Output
Input示例
Output示例
题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1005
分析:学了简单的Java,就来体验了一波Java的爽感,Java大法真的好啊!
下面给出AC代码:
python大法更简单啊!三行代码解决一切问题!
下面给出python3 AC代码:
基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题
给出2个大整数A,B,计算A+B的结果。
Input
第1行:大数A 第2行:大数B (A,B的长度 <= 10000 需注意:A B有可能为负数)
Output
输出A + B
Input示例
68932147586 468711654886
Output示例
537643802472
题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1005
分析:学了简单的Java,就来体验了一波Java的爽感,Java大法真的好啊!
下面给出AC代码:
import java.math.BigInteger; import java.util.Scanner; public class sss { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner in=new Scanner(System.in); BigInteger a,b; a=in.nextBigInteger(); b=in.nextBigInteger(); System.out.println(a.add(b)); } }
python大法更简单啊!三行代码解决一切问题!
下面给出python3 AC代码:
a=int(input()) b=int(input()) print(a+b)
相关文章推荐
- 1005 大数加法 ——51Nod(java BigInteger)
- 51 Nod 1028 大数乘法 V2【Java大数乱搞】
- 51 Nod 1008 N的阶乘 mod P【Java大数乱搞】
- 51 Nod 1027 大数乘法【Java大数乱搞】
- 51 Nod 1029 大数除法【Java大数乱搞】
- 51 Nod 1057 N的阶乘【Java大数乱搞】
- 1005 大数加法(java写大数问题真有优势)
- 51nod1005---大数加法(51nod基础:加减模拟)
- 51nod 1005 大数加法
- 51Nod-1005-大数加法
- hdu-1002-Java大数加法
- 51nod——1005 大数加法
- HDOJ-1002 用JAVA写大数问题[大数加法]
- 51nod-1005 大数加法
- 大数乘法与大数加法 java实现
- 51nod 1005 大数加法
- [乱搞]51 Nod 1421——最大MOD值
- python—大数加法
- 大数加法(JAVA)
- Factorial of large numbers bjfu1005 java实现大数阶乘