首页 > 代码库 > hdu(No.1002)

hdu(No.1002)

注意java不要有包名(并且严格按照输出,一个换行符都不能少):

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T, i = 1;
        T = sc.nextInt();
        BigInteger i1, i2;
        while (true) {

            i1 = sc.nextBigInteger();
            i2 = sc.nextBigInteger();
            System.out.println("Case " + i + ":");
            if (i < T) {
                System.out.println(i1 + " + " + i2 + " = " + i1.add(i2));
                System.out.println();
            } else {
                System.out.println(i1 + " + " + i2 + " = " + i1.add(i2));
                break;
            }
            i++;
        }
    }
}