解题思路:不说了大数a+b,用java的BigInteger类实现方便哪

AC代码如下:

import java.io.*;
import java.util.*;
import java.math.*;

public class Main  //HDOJ类名要Main
{
  public static void main(String[] args)
  {
    Scanner cin=new Scanner(System.in);
    int t,i;
    BigInteger a,b;
    t=cin.nextInt();
    for(i=1;i<=t;i++)
    {
      System.out.println("Case "+i+":");  //System.out.printf("Case %d:\n\t",i);也可以这样
      a=cin.nextBigInteger();
      b=cin.nextBigInteger();
      System.out.println(a+" + "+b+" = "+a.add(b));
      if(i<t)
        System.out.println();
    }
  }
}