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 ...
随机推荐
- Mysql时间范围分区(RANGE COLUMNS方式)
1.创建测试表 CREATE TABLE `t_test` ( `id` ), `dates` DATETIME ); ALTER TABLE t_test ADD PRIMARY KEY (id); ...
- 使用Python绘制新型冠状肺炎全国增长趋势图
截至1月28日24时,国家卫生健康委收到31个省(区.市)累计报告确诊病例5974例,现有重症病例1239例,累计死亡病例132例,累计治愈出院103例.现有疑似病例9239例.目前累计追踪到密切接触 ...
- dac FDMemTable
unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System ...
- JS基础——脚本位置、数据类型、函数作用域
(一)脚本位置 JavaScript是嵌套到浏览器里的脚本语言:可放在3个位置: 1.写在头部(head里) <head> <meta charset="UTF-8& ...
- MySQL--基础SQL--DDL
1.创建数据库 CREATE DATABASE dbname 例: CREATE DATABASE test 2.选择要操作的数据库 USE dbname 例: USE test 3.删除数据库 DR ...
- Node.js—小试牛刀-创建目录
今天第一天学习Node.js 感觉特别亲切 //文件结构 //引入模块 const path=require('path') const fs=require('fs') let roots='H: ...
- 使用idea出现的错误
错误:打开maven项目时出现"程序包 com.sun.org.apache.xpath.internal 不可见 "的错误 这个问题出现的原因是: jdk版本的问题.可能是因为有 ...
- 插曲 强大的神器 vmware
电脑到了 这连天给电脑配环境变量 真的想死 发现用 虚拟机 直接跑别人配置好的镜像文件 多快好省超级开心 比较毒瘤的 clion 不仅要配置c++ 环境 还要走cmake 等一堆东西 ...
- OpenMP笔记(一)
原文:https://www.bearoom.xyz/2019/02/17/openmp1/ 并行技术有很多种,OpenMP算是比较简单可用的一种,OpenMP全称是 Open Multi-Proce ...
- 系统 win 10 专业版 下载地址
thunder://QUFodHRwOi8veHoyLjgxMDg0MC5jb20vY25fd2luZG93c18xMF9jb25zdW1lcl9lZGl0aW9uc192ZXJzaW9uXzE4MD ...