2014.11.1题解(3)---杭电1037
来源:互联网 发布:jsp网站源码 编辑:程序博客网 时间:2024/05/16 09:45
Problem Description
Boudreaux 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?
"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.
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.
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#include<iostream>using namespace std;int main(){ int a,b,c,min; while(cin>>a>>b>>c) { min=a>b? b:a; min=min>c? c:min; if(min<=168) { cout<<"CRASH "<<min<<endl; } else cout<<"NO CRASH"<<endl;} return 0;}
0 0
- 2014.11.1题解(3)---杭电1037
- 2014.11.1题解(1)---杭电1003
- 2014.11.1题解(2)---杭电2041
- 2014.11.1题解(4)——杭电2037
- 杭电“计算机学院大学生程序设计竞赛(2015’11)”题解【1-3】
- 杭电2033题解
- 杭电2006题解
- 杭电1048题解
- 杭电1049题解
- 杭电1052题解
- 杭电试题分类题解
- 杭电oj1025题解析
- 杭电1039题题解
- hdu(杭电oj)第一页题目题解
- 杭电hdu 1053 Entropy题解
- 杭电2115题解题报告
- 杭电 1425 sort 题解报告
- 杭电 1071 The area 题解报告
- 修改IntelliJ IDEA生成注释时的author
- Android开发之Activity设置透明背景
- pat 1078. Hashing (哈希表模拟)
- Android 组件-----Activity保存状态
- 条件数学期望
- 2014.11.1题解(3)---杭电1037
- Cocos开发中性能优化工具介绍之使用Windows任务管理器
- PHP面向对象开发(四)
- 第十四章之Activity返回结果
- LeetCode Spiral Matrix II
- mysql 安装 mysql-5.1.73-linux-x86_64-glibc23
- 智能指针share_ptr使用过程中需要注意的几点
- svn merge 撤销 已提交的修改
- DOS下查看某服务是否开启