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

Posted Fighting Heart

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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\n");
    else printf("false\n");
  }
  return 0;
}

 

以上是关于PAT (Advanced Level) 1065. A+B and C (64bit) (20)的主要内容,如果未能解决你的问题,请参考以下文章

PAT (Advanced Level) 1025. PAT Ranking (25)

PAT Advanced Level 1044

PAT Advanced Level 1043

PAT Advanced Level 1079

PAT Advanced Level 1095

PAT Advanced Level 1038