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?
 

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
#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
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 临时牌掉了一张怎么办 车子在停车场被刮了怎么办 金毛不想养了怎么办 gta5老是掉线怎么办ps4 养狗身上有味道怎么办 身上有异味怎么办%3f 花钱花多了后悔怎么办 想去当兵有纹身怎么办 爸家里人欺负我妈怎么办 部队退伍登记表填错怎么办 新手程序员第一次做项目怎么办 十六岁月经量少怎么办 大姨妈第一天痛怎么办 月经第一天很疼怎么办 神器挑战任务放弃了怎么办 内蒙古森林武警改革新兵怎么办 手挨打了有点肿怎么办 征兵过程中身份证号重复怎么办 去当兵身上有纹身怎么办 武警警卫部队改革新兵怎么办 肾结石3mm很痛怎么办 剖腹产第6天肾结石痛怎么办 左肾5mm结石怎么办 肾结石手术后反复发烧怎么办 百世快递会被退回怎么办 身份证被列入黑名单了怎么办 顺丰寄方客户要求退回快递费怎么办 蛋蛋被皮筋弹肿了怎么办 人肌肉里的绦虫卵怎么办 鞋子前面踢坏了怎么办 猫割完蛋蛋流东西怎么办 北京怡瑞被骗后怎么办 玩滑板睾丸碎了怎么办 雄鸽不会踩蛋怎么办 玩滑板蛋碎了怎么办 精子在精囊满了怎么办 孩子的睾丸一大一小怎么办 肾阳虚早射该怎么办 有奶水吸不出来怎么办 苹果mac商店里没有软件怎么办 战地1安装包损坏怎么办