PAT A1065 A+B and C (64bit) (20 分)
AC代码
#include <cstdio>
int main() {
#ifdef ONLINE_JUDGE
#else
freopen("1.txt", "r", stdin);
#endif // ONLINE_JUDGE
char str[2][10] = {"false", "true"};
int n, tcase = 1;
scanf("%d", &n);
for(int i = 0; i < n; i++) {
int flag = 0;
long long a, b, c;
scanf("%lld%lld%lld", &a, &b, &c);
long long d = a + b;
//printf("%lld %lld %lld %lld\n", a, b, c, d);
/*if(c - b >= a) {
flag = 0;
printf("flag:%d\n", flag);
} else {
flag = 1;
printf("flag:%d\n", flag);
}*/
if(a > 0 && b > 0 && d < 0) flag = 1;
else if(a < 0 && b < 0 && d >= 0) flag = 0;
else if(d > c) flag = 1;
else flag = 0;
printf("Case #%d: %s\n", tcase++, str[flag]);
}
return 0;
}
PAT A1065 A+B and C (64bit) (20 分)的更多相关文章
- A1065 A+B and C (64bit) (20)(20 分)
A1065 A+B and C (64bit) (20)(20 分) Given three integers A, B and C in [-2^63^, 2^63^], you are suppo ...
- 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 (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642
PAT (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642 题目描述: The task is really simple: ...
- PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642
PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642 题目描述: Shuffling is a procedure us ...
- PAT (Advanced Level) Practice 1041 Be Unique (20 分) 凌宸1642
PAT (Advanced Level) Practice 1041 Be Unique (20 分) 凌宸1642 题目描述: Being unique is so important to peo ...
- PAT (Advanced Level) Practice 1015 Reversible Primes (20 分) 凌宸1642
PAT (Advanced Level) Practice 1015 Reversible Primes (20 分) 凌宸1642 题目描述: A reversible prime in any n ...
- PAT甲级:1136 A Delayed Palindrome (20分)
PAT甲级:1136 A Delayed Palindrome (20分) 题干 Look-and-say sequence is a sequence of integers as the foll ...
- PAT乙级:1094 谷歌的招聘 (20分)
PAT乙级:1094 谷歌的招聘 (20分) 题干 2004 年 7 月,谷歌在硅谷的 101 号公路边竖立了一块巨大的广告牌(如下图)用于招聘.内容超级简单,就是一个以 .com 结尾的网址,而前面 ...
- PAT乙级:1053 住房空置率 (20分)
PAT乙级:1053 住房空置率 (20分) 题干 在不打扰居民的前提下,统计住房空置率的一种方法是根据每户用电量的连续变化规律进行判断.判断方法如下: 在观察期内,若存在超过一半的日子用电量低于某给 ...
随机推荐
- elastic search&logstash&kibana 学习历程(四)kibana安装部署和使用
kibana在linux上的部署安装 运行环境是centos7 基于jdk8 下载安装包:wget https://artifacts.elastic.co/downloads/kibana/kiba ...
- js切换全屏
直接撸代码 //<a id="fullscreen">切换按钮</a> $('#fullscreen').bind('click',function () ...
- 如何让spark sql写mysql的时候支持update操作
如何让sparkSQL在对接mysql的时候,除了支持:Append.Overwrite.ErrorIfExists.Ignore:还要在支持update操作 1.首先了解背景 spark提供了一个枚 ...
- Flutter制作Toast会自己关闭的消息提示框
项目中需要用到类似安卓的Toast提示框,因为flutter中又没有相关组件,然后在网上看到个不错的,地址https://www.jianshu.com/p/cf7877c9bdeb,然后拿过来修改了 ...
- springboot多个数据源
1.启动两个mysql,可以按照如下操作使用docker来部署mysql容器,比较简单 https://www.cnblogs.com/qq931399960/p/11527222.html 2.如果 ...
- centos7 下设置 mongodb 开机启动 (重点)
centos 7的开机启动跟之前版本的centos有很大不同.现在用 systemctl命令代替了之前的chkconfig 和 service 命令 注册到开机启动的方法如下: 在系统服务目录下新建m ...
- C realloc
https://baike.baidu.com/item/realloc/659993?fr=aladdin 也就是说:原地址后面有连续可以空间可以满足需要,则追加在后面,否则开辟新空间,并拷贝数据
- 软件-设计-Adobe-Adobe XD:百科
ylbtech-软件-设计-Adobe-Adobe XD:百科 创建线框.设计.创建原型.展示以及共享适用于 Web.移动设备和语音等的卓越体验 - 以上操作在一款应用程序中即可完成.XD 面向需要进 ...
- AS中集成bug管理系统
这里大家可以选择各种Bug管理工具,几乎包括了市面上常用的各种Bug跟踪管理工具. 由于如:点击JIRA,填入公司JIRA服务器的地址,填入Server.Username和密码即可,点击Test,弹出 ...
- JVM学习笔记之初识JVM(三)
一.JVM在计算机中的位置 JVM调用操作系统,操作系统调用硬件,硬件反馈信息至操作系统,操作系统反馈信息至JVM 二.JVM的体系结构 JVM在执行过程中对内存的管理分为5个区域: 1.PC寄存器 ...