码迷,mamicode.com
首页 > 编程语言 > 详细

hdu 1002 Java 大数 加法

时间:2014-09-29 01:58:37      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:blog   http   ar   java   for   sp   2014   c   log   

http://acm.hdu.edu.cn/showproblem.php?pid=1002

PE   因为最后一个CASE不需要输出空行

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

public class Main {
	public static void main(String args[]){
		Scanner in = new Scanner(System.in);
		int ncase;
		ncase = in.nextInt();
		for(int i=1;i<=ncase;i++){
			BigInteger a= in.nextBigInteger();
			BigInteger b= in.nextBigInteger();
			System.out.println("Case" + " " + i + ":");
			System.out.println(a + " + " + b + " = " + a.add(b));
			if(i<ncase)System.out.println();
			
		}
	}
}


hdu 1002 Java 大数 加法

标签:blog   http   ar   java   for   sp   2014   c   log   

原文地址:http://blog.csdn.net/u011026968/article/details/39649757

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!