java做大数加法
java做大数运算的类是BigInteger
import java.util.Scanner;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) {
BigInteger a,b,c;
int n;
Scanner cin = new Scanner(System.in);
n = cin.nextInt();
for(int i=1;i<=n;i++)
{
a = cin.nextBigInteger();
b = cin.nextBigInteger();
c = a.add(b);
System.out.println("Case " + i + ":");
System.out.println(a + " + " + b + " = " + c);
if(i!=n)
System.out.println();
}
}
}