一、题目描述
Input Specification:
Output Specification:
Sample Input:
3
1 2 3
2 3 4
9223372036854775807 -9223372036854775808 0
Sample Output:
Case #1: false
Case #2: true
Case #3: false
二、解题思路
这道题取了个巧,直接用long double存储数据,更科学的方法可以去参考柳神的解答,好像要重载大于号…
三、AC代码
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long LL;
int main()
{
int T;
long double a, b, c;
scanf("%d", &T);
for(int i=0; i<T; i++)
{
scanf("%llf%llf%llf", &a, &b, &c);
if(a + b > c)
printf("Case #%d: true\n", i+1);
else
printf("Case #%d: false\n", i+1);
}
return 0;
}