注意對溢出的處理即可
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
long long a,b,c;
int t;
cin >> t;
for(int i=1; i<=t; i++){
cin >> a >> b >> c;
cout << "Case #" << i << ": ";
if((a>=0 && b<=0) || (a<=0 && b>=0)){
if(a+b>c){
cout << "true" << endl;
}
else{
cout << "false" << endl;
}
}
else if(a>0){
if(a+b<a){
cout << "true" << endl;
}
else if(a+b>c){
cout << "true" << endl;
}
else{
cout << "false" << endl;
}
}
else if(a<0){
if(a+b>a){
cout << "false" << endl;
}
else if(a+b>c){
cout << "true" << endl;
}
else{
cout << "false" << endl;
}
}
}
system("pause");
return 0;
}