51nod 1005 大数加法

 
基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题
 
Input
第1行:大数A
第2行:大数B
(A,B的长度 <= 10000 需注意:A B有可能为负数)
 
Output
输出A + B
 
Input示例
68932147586
468711654886
 
Output示例
537643802472

Java在处理大数据方面很具有优势~~~~~~~~~~~~~~~~~~~

import java.math.BigInteger;
import java.util.Scanner;

public class Demo01 {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		BigInteger integer = new BigInteger(scanner.nextLine().trim());
		BigInteger integer2 = new BigInteger(scanner.nextLine().trim());
		integer = integer.add(integer2);
		System.out.print(integer);
	}
}

  

 
posted @ 2017-08-05 20:22  浅忆~  阅读(137)  评论(0编辑  收藏  举报