当前位置:网站首页>Pat class B 1011 C language
Pat class B 1011 C language
2022-06-23 05:54:00 【Octopus bro】
1011. A+B and C (15)
Given the interval [-231, 231] Internal 3 It's an integer A、B and C, Please judge A+B Is it greater than C.
Input format :
Enter the first 1 Line gives a positive integer T(<=10), Is the number of test cases . Subsequently given T Group test cases , One row for each group , The order is given A、B and C. Integers are separated by spaces .
Output format :
For each group of test cases , Output in one line “Case #X: true” If A+B>C, Otherwise output “Case #X: false”, among X Is the number of the test case ( from 1 Start ).
sample input :4 1 2 3 2 3 4 2147483647 0 2147483646 0 -2147483648 -2147483647sample output :
Case #1: false Case #2: true Case #3: true Case #4: false
Ideas : Just judge directly , Attention, because the process may exceed int Value range of , Therefore, using long int Declare variables
Code :
#include "stdio.h"
int main(){
int x;
long int a,b,c;
int i;
scanf("%d",&x);
for(i = 0; i < x; i++)
{
scanf("%ld",&a);
scanf("%ld",&b);
scanf("%ld",&c);
if(a + b > c)
{
printf("Case #%d: true\n",i + 1);
}else
{
printf("Case #%d: false\n",i + 1);
}
}
return 0;
} 边栏推荐
- Arctime makes Chinese and English subtitle video
- PAT 乙等 1024 科学记数法 C语言
- APP SHA1获取程序 百度地图 高德地图获取SHA1值的简单程序
- Yingjixin launched 4 series of lithium batteries 100W mobile power supply voltage rise and fall scheme SOC chip ip5389
- Kotlin android简单Activity跳转、handler和thread简单配合使用
- Use of visdom
- Mobile phone wireless charging dual coil 15W scheme SOC IC ip6809
- Jvm: when a method is overloaded, the specific method to call is determined by the static type of the incoming parameter rather than the actual type of the parameter
- Real MySQL interview question (30) -- shell real estate order analysis
- PAT 乙等 1014 C语言
猜你喜欢

【owt】owt-client-native-p2p-e2e-test vs2017构建 6:修改脚本自动生成vs工程

The digital collection market has just begun

jvm-03.jvm内存模型

Heimdall database proxy scale out 20 times

How to move the software downloaded from win11 app store to the desktop

阿里云对象存储oss+picgo+typora实现构建图床

True MySQL interview question (XXII) -- condition screening and grouping screening after table connection

如何指定pig-register项目日志的输出路径

What is the magic of digital collections? Which reliable teams are currently developing

数字藏品赋能实体产业释放了哪些利好?
随机推荐
Wechat applet: Puzzle toolbox
What is the reason for the black screen of the computer monitor when the computer is turned on? What should I do about the black screen of the computer monitor
Pit filling for abandoned openssl-1.0.2 (.A to.So)
Skill self check | do you know these 6 skills if you want to be a test leader?
Real MySQL interview question (30) -- shell real estate order analysis
Centos7部署radius服务-freeradius-3.0.13-15.el7集成mysql
Alibaba cloud ack one and ACK cloud native AI suite have been newly released to meet the needs of the end of the computing era
Analysis on the problems and causes of digital transformation of manufacturing industry
MySQL面试真题(二十六)——滴滴2020年笔试题
APP SHA1获取程序 百度地图 高德地图获取SHA1值的简单程序
Advanced Mathematics (Seventh Edition) Tongji University exercises 1-8 personal solutions
PAT 乙等 1024 科学记数法 C语言
How can digital collections empower economic entities?
PAT 乙等 1009 C语言
Low cost 5W wireless charger scheme fs68001b simple charging chip
MySQL面试真题(三十)——贝壳-房产订单分析
C prime plus notes d'apprentissage - 2, constantes et formatage io (I / o)
Yingjixin ip6806 wireless charging scheme 5W Qi certified peripheral simplified 14 devices
ORB_SLAM2运行
PAT 乙等 1019 C语言