PAT (Advanced Level) 1065. A+B and C (64bit) (20)

因为会溢出,因此判断条件需要转化。变成b>c-a

#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;

long long a,b,c;

int main()
{
  int T; scanf("%d",&T);
  int Case=1;
  while(T--)
  {
    scanf("%lld%lld%lld",&a,&b,&c);
    printf("Case #%d: ",Case++);
    if(b>c-a) printf("true
");
    else printf("false
");
  }
  return 0;
}
原文地址:https://www.cnblogs.com/zufezzt/p/5616764.html