A+B Problem II

问题陈述:

  杭州电子科技大学 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

posted @ 2015-02-08 21:41  HelloMichaelWong  阅读(955)  评论(0编辑  收藏  举报