题意:

输入三个整数A,B,C(long long范围内),输出是否A+B>C。

trick:

测试点2包括溢出的数据,判断一下是否溢出即可。

AAAAAccepted code:

 #define HAVE_STRUCT_TIMESPEC
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin>>t;
for(int i=;i<=t;++i){
if(i!=)
cout<<"\n";
long long a,b,c;
cin>>a>>b>>c;
long long x=a+b;
if(a>&&b>&&x<){
cout<<"Case #"<<i<<": true";
continue;
}
else if(a<&&b<&&x>=){
cout<<"Case #"<<i<<": false";
continue;
}
long long d=a+b;
if(d>c)
cout<<"Case #"<<i<<": true";
else
cout<<"Case #"<<i<<": false";
}
return ;
}

【PAT甲级】1065 A+B and C (64bit) (20 分)(大数溢出)的更多相关文章

  1. PAT 甲级 1065 A+B and C (64bit) (20 分)(溢出判断)*

    1065 A+B and C (64bit) (20 分)   Given three integers A, B and C in [−], you are supposed to tell whe ...

  2. PAT 甲级 1065. A+B and C (64bit) (20) 【大数加法】

    题目链接 https://www.patest.cn/contests/pat-a-practise/1065 思路 因为 a 和 b 都是 在 long long 范围内的 但是 a + b 可能会 ...

  3. pat 甲级 1065. A+B and C (64bit) (20)

    1065. A+B and C (64bit) (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 HOU, Qiming G ...

  4. PAT Advanced 1065 A+B and C (64bit) (20 分)(关于g++和clang++修改后能使用)

    Given three integers A, B and C in [−], you are supposed to tell whether A+B>C. Input Specificati ...

  5. PAT甲级:1124 Raffle for Weibo Followers (20分)

    PAT甲级:1124 Raffle for Weibo Followers (20分) 题干 John got a full mark on PAT. He was so happy that he ...

  6. PAT甲级——1065 A+B and C (64bit)

    1065 A+B and C (64bit) Given three integers A, B and C in [−2​63​​,2​63​​], you are supposed to tell ...

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

    题目 Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C. Inpu ...

  8. PAT 甲级 1069 The Black Hole of Numbers (20 分)(内含别人string处理的精简代码)

    1069 The Black Hole of Numbers (20 分)   For any 4-digit integer except the ones with all the digits ...

  9. 【PAT甲级】1104 Sum of Number Segments (20 分)

    题意:输入一个正整数N(<=1e5),接着输入N个小于等于1.0的正数,输出N个数中所有序列的和. AAAAAccepted code: #define HAVE_STRUCT_TIMESPEC ...

随机推荐

  1. Linux jpeglib库的安装

    tar -zxvf jpegsrc.v9.tar.gz cd jpeg9 ./configure --enable-shared  --enable-static 分别对动态链接库和静态链接库的支持 ...

  2. 【做题笔记】P1330 封锁阳光大学

    读题易得:对于有边的两个点 \(u,v\) ,能且仅能其中一点对这条边进行封锁. 什么意思呢?假设给这张图上的点进行染色,那么对于上述的两个点 \(u,v\) ,\(u,v\) 必须异色(理解这一点很 ...

  3. IntelliJ IDEA 2017.3尚硅谷-----设置界面

  4. C++11 新特性学习

    在Linux下编译C++11 #include<typeinfo> int main() { auto a=; cout<<typeid(a).name()<<en ...

  5. MNIST 数据集

    mnist 数据集:包含 7 万张黑底白字手写数字图片,其中 55000 张为训练集,5000 张为验证集,10000 张为测试集.每张图片大小为 28*28 像素,图片中纯黑色像素值为 0,纯白色像 ...

  6. 密码学笔记——eval(function(p,a,c,k,e,d) 加密破解

    密码学笔记——eval(function(p,a,c,k,e,d) 的加密破解 例题: 小明某天在看js的时候,突然看到了这么一段代码,发现怎么也理不出代码逻辑,你能帮帮他吗? 格式:SimCTF{} ...

  7. JetBrains PyCharm 2018.2.1 x64永久激活码

    812LFWMRSH-eyJsaWNlbnNlSWQiOiI4MTJMRldNUlNIIiwibGljZW5zZWVOYW1lIjoi5q2j54mIIOaOiOadgyIsImFzc2lnbmVlT ...

  8. 虚拟机kali Linux 的网络配置

    首先打开虚拟机中的kali 发现是没有办法连网的 然后我们将kaili关闭 然后打开 然后看黄色区域选择桥接模式然后重新启动即可 https://jingyan.baidu.com/article/7 ...

  9. linux 复制系统盘 dd

    lsblk sudo dd  if=/dev/mmcblk0 of=/dev/sda bs=8M sudo watch -n 5 pkill -USR1 ^dd$

  10. yii2关闭(开启)csrf的验证

    (1)全局使用,我们直接在配置文件中设置enableCookieValidation为true request => [ 'enableCookieValidation' => true, ...