判断一下是否溢出
注意等号只在小于0相加是才有
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
LL a, b, c;
int t;
int main()
{
scanf("%d", &t);
for (int i = 1; i <= t; i++)
{
printf("Case #%d: ", i);
LL sum;
scanf("%lld%lld%lld", &a, &b, &c);
sum = a + b;
bool f = false;
if (a > 0 && b > 0 && sum < 0)f = true;
else if (a < 0 && b < 0 && sum>=0)f = false;
else if (sum > c)f = true;
else f = false;
if (f)printf("true\n");
else printf("false\n");
}
return 0;
}