JAVA 大数A+B




大数A+B


代码:

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int T=input.nextInt();
		for(int Case=1;Case<=T;Case++){
			BigInteger a=input.nextBigInteger();
			BigInteger b=input.nextBigInteger();
			System.out.println("Case "+Case+":");
			System.out.println(a+" + "+b+" = "+a.add(b));
			if(Case!=T) System.out.println();
		}
	}
}


你可能感兴趣的:(JAVA 大数A+B)