杭电1037——Keep on Truckin'(简单题)
2015-11-08 16:40
453 查看
题目描述
Problem DescriptionBoudreaux and Thibodeaux are on the road again …
“Boudreaux, we have to get this shipment of mudbugs to Baton Rouge by tonight!”
“Don’t worry, Thibodeaux, I already checked ahead. There are three underpasses and our 18-wheeler will fit through all of them, so just keep that motor running!”
“We’re not going to make it, I say!”
So, which is it: will there be a very messy accident on Interstate 10, or is Thibodeaux just letting the sound of his own wheels drive him crazy?
Input
Input to this problem will consist of a single data set. The data set will be formatted according to the following description.
The data set will consist of a single line containing 3 numbers, separated by single spaces. Each number represents the height of a single underpass in inches. Each number will be between 0 and 300 inclusive.
Output
There will be exactly one line of output. This line will be:
NO CRASH
if the height of the 18-wheeler is less than the height of each of the underpasses, or:
CRASH X
otherwise, where X is the height of the first underpass in the data set that the 18-wheeler is unable to go under (which means its height is less than or equal to the height of the 18-wheeler).
The height of the 18-wheeler is 168 inches.
Sample Input
180 160 170
Sample Output
CRASH 160
题意大致翻译
让你输入三个地下隧道的高度,已知货车的高度为168,如果地下隧道的高度都大于货车高度(168),则输出NO CRASH,否则,若是某条隧道的高度低于或者等于货车的高度,则输出CRASH X,其中X是该隧道的高度。题目很简单,看懂题意就行~
AC代码
# include<stdio.h> int main() { int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a>168&&b>168&&c>168) printf("NO CRASH\n"); else { if(a<=168) printf("CRASH %d\n",a); if(b<=168) printf("CRASH %d\n",b); if(c<=168) printf("CRASH %d\n",c); } return 0; }
相关文章推荐
- 关于Android Studio使用Gradle多渠道打包的一些记录
- matplotlib中legend位置调整
- android jni签名验证(二)
- 浮动
- 在windows环境下安装redis和phpredis的扩展
- 常用排序算法
- 20135316王剑桥 linux第七周课实验笔记
- jquery简单的选项卡
- 使用JSON格式传递数据,获取JSON的值
- 关于网络三 - XML 生成及解析、JSON 解析
- 如何理解多个域名解析到同一个服务器空间上?
- 布局复习---BFC
- trim mybtais
- 超实用的JavaScript代码段 Item5 --图片滑动效果实现
- 求生之路升级2140常见问题
- android获得sd卡和本机内存大小
- Spark RDD中Transformation的map、flatMap、mapPartitions、glom详解
- 快速排序
- linux 入门级常用指令
- 文字导航栏的做法