题目:https://www.patest.cn/contests/pat-a-practise/1065
代码:
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
using namespace std;
int main()
{
long long a,b,c;
int n,i,flag=0;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%lld%lld%lld",&a,&b,&c);
long long res=a+b;
if(a>0&&b>0&&res<0){
flag=1;
}else if(a<0&&b<0&&res>=0){
flag=0;
}else if(res>c){
flag=1;
}else{
flag=0;
}
if(flag==1){
printf("Case #%d: true\n",i);
}else{
printf("Case #%d: false\n",i);
}
}
system("pause");
}