题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1002
简单的大数加法
源代码:
import java.math.BigInteger;
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
int t;
Scanner scanner=new Scanner(System.in);
t=scanner.nextInt();
for (int i = 1; i <=t; i++) {
String str1,str2;
BigInteger A,B;
str1=scanner.next();
str2=scanner.next();
A=new BigInteger(str1);
B=new BigInteger(str2);
System.out.println("Case "+i+":");
System.out.print(A+" + " +B +" = " );
System.out.println(A.add(B));
if(i!=t){
System.out.println();
}
}
}
}