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 分)的更多相关文章

  1. 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 ...

  2. 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 ...

  3. PAT (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642 题目描述: The task is really simple: ...

  4. PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642 题目描述: Shuffling is a procedure us ...

  5. 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 ...

  6. PAT (Advanced Level) Practice 1015 Reversible Primes (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1015 Reversible Primes (20 分) 凌宸1642 题目描述: A reversible prime in any n ...

  7. PAT甲级:1136 A Delayed Palindrome (20分)

    PAT甲级:1136 A Delayed Palindrome (20分) 题干 Look-and-say sequence is a sequence of integers as the foll ...

  8. PAT乙级:1094 谷歌的招聘 (20分)

    PAT乙级:1094 谷歌的招聘 (20分) 题干 2004 年 7 月,谷歌在硅谷的 101 号公路边竖立了一块巨大的广告牌(如下图)用于招聘.内容超级简单,就是一个以 .com 结尾的网址,而前面 ...

  9. PAT乙级:1053 住房空置率 (20分)

    PAT乙级:1053 住房空置率 (20分) 题干 在不打扰居民的前提下,统计住房空置率的一种方法是根据每户用电量的连续变化规律进行判断.判断方法如下: 在观察期内,若存在超过一半的日子用电量低于某给 ...

随机推荐

  1. 关于tensorflow里面的tf.contrib.rnn.BasicLSTMCell 中num_units参数问题

    这里的num_units参数并不是指这一层油多少个相互独立的时序lstm,而是lstm单元内部的几个门的参数,这几个门其实内部是一个神经网络,答案来自知乎: class TRNNConfig(obje ...

  2. 如何利用新浪官方的短网址API接口实现T.cn短链接的压缩生成

    短网址的实现原理就是有一个数据表会配置文件将短网址和实际网址进行对应,当请求某个短网址时,程序跳转到对应的实际网址上去,从而实现网址的访问.目前国内最稳定最好用的是新浪T.cn短链接. 之前新浪提供了 ...

  3. thinkphp6下载安装与配置图文详细讲解教程(composer下载安装)

    thinkphp6发布也有一段时间了,相对来说比较稳定,是时候学习一下thinkphp6框架,提前学习,到正式发布的时候,可以直接拿来做正式的项目,先人一步.thinkPHP6.0在5.1的基础上对底 ...

  4. Linux环境下Gitblit服务搭建及秘钥配置

    一.安装gitblit服务 1.下载地址 https://pan.baidu.com/s/1wQ3TEE_gw5xZvyFPZB9xFg 2.上传至linux服务器并解压缩 tar xvf gitbl ...

  5. Vue小实例

    最近刚学习Vue的官方文档,了解了指令.模板.组件.数据双向绑定等有关Vue的知识点.因此估摸着做点实例出来练练手. 下面介绍一个简单的例子,模拟购物车自动统计金额,效果图如下: 代码如下: < ...

  6. HDU 4612 Warm up —— (缩点 + 求树的直径)

    题意:一个无向图,问建立一条新边以后桥的最小数量. 分析:缩点以后,找出新图的树的直径,将这两点连接即可. 但是题目有个note:两点之间可能有重边!而用普通的vector保存边的话,用v!=fa的话 ...

  7. Linux Redis的性能展示

    我们可以通过redis-cli 连接上redis ,例如 : redis-cli -h 127.0.0.1 -p 6379 连接上redis,然后通过INFO查看redis的一些信息.我们可以查看一些 ...

  8. centos7 安装 ftp 服务及创建 repo源

    安装 ftp 服务 安装和启动服务:# yum install vsftpd# systemctl enable vsftpd# systemctl start vsftpd 配置文件: vi /et ...

  9. Android RecyclerView实现加载多种条目类型

    今天咱们是用RecyclerView来实现这个多种Item的加载. 其实最关键的是要复写RecyclerView的Adapter中的getItemViewType()方法 这个方法就根据条件返回条目的 ...

  10. 【批处理】ren命令_批量重命名文件

    [ren命令] 说明:ren是“rename(重命名)”的简写: 命令:REN [Drive:][path] <old filename> <new filename> 解释: ...