此题主要考虑数据范围的问题,用java大数可直接解决。
import java.math.BigInteger;
import java.util.Scanner;
/**
Created by HarvestWu on 2018/4/22.
*/
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int t = in.nextInt();
int count=1;
while (t-->0){
BigInteger a = in.nextBigInteger();
BigInteger b = in.nextBigInteger();
BigInteger c = in.nextBigInteger();
if (a.add(b).compareTo(c)>0)
System.out.println("Case #"+count+": true");
else System.out.println("Case #"+count+": false");
count++;
}
}
}