题意:

输入三个整数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. (转)java内存分配分析/栈内存、堆内存

    转自(http://blog.csdn.net/qh_java/article/details/9084091) java内存分配分析/栈内存.堆内存 java内存分配分析 本文将由浅入深详细介绍Ja ...

  2. apache+SSL 搭建https

    简单介绍 一般情况下,我们打开网站默认的是使用明文传输方式,但在日常生活中,当我们在登录或者支付交易时,网站就会自动跳转至SSL(Secure Sockets Layes)加密传输模式,SSL的功能就 ...

  3. poj 1611 :The Suspects经典的并查集题目

    Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized ...

  4. Linux05——用户操作

    用户操作 1.新增用户(useradd 新用户名): 2.设置密码(passwd 用户名): 3.用户是否存在(id  用户名): 4.切换用户(su - 切换用户名) **—— **       s ...

  5. Git的基本使用 -- Git配置

    文件种类 仓库级别(当前仓库有效) local 用户级别(当前用户有效) global 系统级别(系统全局有效) system 系统级别的配置 git config --system user.nam ...

  6. 线性筛-prime,强大O(n)

    和朴素的素数筛法一样,flag数组,记录x是否为素数 flag[x]=0,x为合数 falg[x]=1,x为素数 flag[1],无定义 其核心思想是,用x筛除与之差异最小的y,达到时间上O(n)的目 ...

  7. bugku getshell

    http://123.206.87.240:8002/web9/ 该题是walf严格匹配,通过修改Content-type后字母的大小写可以绕过检测, 然后还有,后缀黑名单检测和类型检测,逐个绕过,如 ...

  8. Python单例

    01. 单例设计模式 设计模式 设计模式 是 前人工作的总结和提炼,通常,被人们广泛流传的设计模式都是针对 某一特定问题 的成熟的解决方案 使用 设计模式 是为了可重用代码.让代码更容易被他人理解.保 ...

  9. HashMap知识初探

    public class TestHashMap { /** * HashMap是数组和链表组合构成的数据结构 * 数组里面每个地方都存了key-value这样的实例Java7叫Entry,Java8 ...

  10. frp 使用基础笔记

    0x01 简介 为什么需要内网穿透? 很多时候从公网访问自己内网的设备是困难的,毕竟自己没有一个独立的IP地址. Frp 服务器进行内网穿透,速度快还十分简单.可以实现很多功能,包括不限于远程桌面,文 ...