【PAT甲级】1065 A+B and C (64bit) (20 分)(大数溢出)
题意:
输入三个整数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 分)(大数溢出)的更多相关文章
- 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 ...
- PAT 甲级 1065. A+B and C (64bit) (20) 【大数加法】
题目链接 https://www.patest.cn/contests/pat-a-practise/1065 思路 因为 a 和 b 都是 在 long long 范围内的 但是 a + b 可能会 ...
- 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 ...
- 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 ...
- 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 ...
- PAT甲级——1065 A+B and C (64bit)
1065 A+B and C (64bit) Given three integers A, B and C in [−263,263], you are supposed to tell ...
- 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 ...
- 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 ...
- 【PAT甲级】1104 Sum of Number Segments (20 分)
题意:输入一个正整数N(<=1e5),接着输入N个小于等于1.0的正数,输出N个数中所有序列的和. AAAAAccepted code: #define HAVE_STRUCT_TIMESPEC ...
随机推荐
- 《E=MC2或一个思想的故事》
思想是起点.一切行动都以萌芽状态孕藏在思想之中,以往所做过的一切均离不开思想. 他是个纯朴的人,喜欢在乡下静静地冥想. .而科学家们却非常清楚,那些最伟大的成就都是在静默中完成的.
- 【做题笔记】洛谷P1464 Function
我先谔谔一波 /kk 我谔谔 看题第一眼:欸这不就是按题意递归嘛,,直接搞不就好了 3 min 后,重新看题 然后自己手玩了几个样例,噢,递归太多了,铁定会 T 啊...... 然后,作为一个从没写过 ...
- java基础(十一)之抽象类和抽象函数
1.抽象函数的语法特征2.抽象类的语法特征3.抽象类的作用 抽象函数 只有函数的定义,没有函数体的函数被称为抽象函数: abstract void func(); 抽象类 使用abstract定义的类 ...
- PMP概略学习下--主体内容
4 知识主体 4.1 主要知识简介 PMP所有的知识围绕五大过程组和十大知识领域展开.五大过程组包括启动.规划.执行.监控.结尾.启动的内容主要是定义项目或阶段.获得授权以及正式开始:规划的内容主要 ...
- Scrapy爬虫基本使用
一.Scrapy爬虫的第一个实例 演示HTML地址 演示HTML页面地址:http://python123.io/ws/demo.html 文件名称:demo.html 产生步骤 步骤1:建议一个Sc ...
- 直方图histeq
histeq的原理: [MN]=size(H); [counts,x]=imhist(H);%H是读取的图像,imhist是对图像直方图进行统计,其中count,是每个灰度值得个数,x代表灰度值.一般 ...
- Visual Studio Code修改全屏背景
打开VSCode安装目录,找到workbench.desktop.main.css文件 在最后一行添加以下代码: body{ pointer-events:auto !important; backg ...
- 线段树+扫描线 NAIPC 2019 Intersecting Rectangles
你看看你有多菜,一点线段树的小小的运用,就不会写了: 题意:如果矩阵有交集,输出1,否则输出0(不包含内嵌): 思路:本题求交集,还得不包括内嵌的情况: 做过一道是求面积的题.跟这道类似,但在这里定义 ...
- 2019南昌网络赛 hello 2019
这道题和一道2017,2016的类似. A string t is called nice if a string “2017” occurs in t as a subsequence but a ...
- Homebrew安装和Mac使用
软件安装 1.Homebrew安装 ruby环境: curl -sSL https://get.rvm.io | bash -s stable 官网方式: /usr/bin/ruby -e & ...