码迷,mamicode.com
首页 > 其他好文 > 详细

A+B Problem II

时间:2015-02-08 21:50:48      阅读:103      评论:0      收藏:0      [点我收藏+]

标签:

问题陈述:

  杭州电子科技大学 HANGZHOU DIANZI UNIVERSITY Online Judge Problem - 1002

 

代码详解(Java):  

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(new BufferedInputStream(System.in));
        int t, id = 0;
        BigInteger a, b, c;
        t = sc.nextInt();
        while(t-- > 0) {
            id++;
            a = sc.nextBigInteger();
            b = sc.nextBigInteger();
            c = a.add(b);
            System.out.println("Case " + id + ":");
            System.out.println(a + " + " + b + " = " + c);
            if(t != 0) {
                System.out.println("");
            }
        }
        sc.close();
    }
}

 

转载请注明出处:http://www.cnblogs.com/michaelwong/p/4280526.html

A+B Problem II

标签:

原文地址:http://www.cnblogs.com/michaelwong/p/4280526.html

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