A + B Problem II

import java.io.*;
import java.util.*; 
import java.math.*;
import java.lang.*;
import java.text.*; 
class Main
{
    public static void main(String[] argc)
    {
        Scanner cin=new Scanner(System.in);
        BigInteger a,b,sum;
        a=BigInteger.valueOf(0);
        b=BigInteger.valueOf(0);
        sum=BigInteger.valueOf(0);
        int n,i=1;
        n=cin.nextInt();
        while(cin.hasNext())
        {
            while(n--!=0)
            {
                a=cin.nextBigInteger();
                b=cin.nextBigInteger();
                sum=a.add(b);
                System.out.println("Case "+ i +":");
                System.out.println(a + " + " + b + " = " + sum);
                if(n!=0)System.out.println();
                i++;
            }
        }
    }
}

posted @ 2012-08-22 12:16  疼痛落在指尖  阅读(98)  评论(0编辑  收藏  举报