PAT甲级——1065 A+B and C (64bit)
Given three integers A, B and C in [−263,263], you are supposed to tell whether A+B>C.
Input Specification:
The first line of the input gives the positive number of test cases, T (≤10). Then T test cases follow, each consists of a single line containing three integers A, B and C, separated by single spaces.
Output Specification:
For each test case, output in one line Case #X: true
if A+B>C, or Case #X: false
otherwise, where X is the case number (starting from 1).
Sample Input:
3
1 2 3
2 3 4
9223372036854775807 -9223372036854775808 0
Sample Output:
Case #1: false
Case #2: true
Case #3: false
#include <cstdio>
int main(){
int n,i;
long long int a,b,c;
scanf("%d",&n);
for(i=1;i<=n;++i){
bool flg = true;
scanf("%lld %lld %lld",&a,&b,&c);
long long res = a+b;
if(a>0 && b>0 && res<=0)flg = true;
else if(a<0 && b<0 && res>=0)flg = false;
else{
if(res<=c)flg = false;
}
if(flg){
printf("Case #%d: true\n",i);
}else{
printf("Case #%d: false\n",i);
}
}
return 0;
}
PAT甲级——1065 A+B and C (64bit)的更多相关文章
- 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 甲级 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) 乙级1010一元多项式求导
甲级1065 1065 A+B and C (64bit) (20 point(s)) Given three integers A, B and C in [−263,263], you ...
- 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(A) 1065. A+B and C (64bit) (java大数)
代码: import java.util.*; import java.math.*; public class Main { public static void main(String args[ ...
- 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甲级——A1065 A+B and C (64bit)
Given three integers A, B and C in [−], you are supposed to tell whether A+B>C. Input Specificati ...
- 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 ...
随机推荐
- JavaWeb之搭建自己的MVC框架(三)
1. 前言 在前两节的内容中,我们完成了一个基本的框架搭建.但是如果我们在前端请求中增加参数,我们要怎么传递到后台方法呢?接下来我们就来研讨这部分内容. 2. 实现 ( ...
- 19 01 04 CSS3 圆角 grba(带通明的) tansition动画 transform变换 animation动画
CSS3圆角 设置某一个角的圆角,比如设置左上角的圆角:border-top-left-radius:30px 60px; 同时分别设置四个角: border-radius:30px 60px 120 ...
- win10编译libpng
libpng在windows的编译. ligpng的官网介绍如下: libpng is the official PNG reference library. It supports almost a ...
- jquery---利用jquery插件生成二维码
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquer ...
- Android如何用一个TextView显示不同颜色得字符
最近做一个项目,需要一个字符串显示不同的颜色.当时直接想到的就是用多个TextView来拼接,但是如果字符数量多的话,这样写是非常麻烦得.而且还要增加很多控件. 后来发现一个非常方便得方法.直接看代码 ...
- 正文内容 python3编码问题
来源:http://www.jb51.net/article/92006.htm 以下是全文: 这两天写了个监测网页的爬虫,作用是跟踪一个网页的变化,但运行了一晚出现了一个问题....希望大家不吝赐教 ...
- vue 动画框架Animate.css @keyframes
<script src="vue.js"></script> <link rel="stylesheet" href=" ...
- CodeForces 382B 数学推导
这个题目题意简单,但是TLE得哭哭的... 输入 a b w x c五个数,最终要使得c<=a, 每一秒可以进行一个操作,如果b>=x,则 b=b-x,同时 c--;如果b<x,则a ...
- Innodb-内存架构与特性
参考文档 Innodb特性buffer_pool http://mysql.taobao.org/monthly/2017/05/01/?spm=a2c4e.11153940.blogcont2812 ...
- Salt常用命令二
############################模块############################ 查看模块列表——module salt ‘minion’ sys.list_mo ...