杭电acm--1037
2015-10-13 19:20
405 查看
[align=left]Input[/align]
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.
[align=left]Output[/align]
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.
大意:输入三个不大于300的数,如果大于168,则输出 CRASH X,如果没有小于168的数,则输出NO CRASH
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.
[align=left]Output[/align]
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.
大意:输入三个不大于300的数,如果大于168,则输出 CRASH X,如果没有小于168的数,则输出NO CRASH
#include<stdio.h> #include<stdlib.h> #include<iostream> #include<cmath> #include<iomanip> //#define P 3.141592653 using namespace std; void main() { int x, y, z; cin >> x >> y >> z; if (x <= 300 && y <= 300 && z <= 300) if (x<168) cout << "CRASH " << x<< endl; else if (y<168) cout << "CRASH " << y << endl; else if (z<168) cout << "CRASH " << z << endl; else cout << "NO CRASH" << endl; system("pause"); }
相关文章推荐
- 借贷宝“自我绑架”:传销式推广只能“烧钱”玩下去?
- ios短信和电话--参考
- Reachability网络判断
- 【停课集训10.13】【#3 training】
- js中的引用赋值
- BZOJ 1093: [ZJOI2007]最大半连通子图( tarjan + dp )
- 高效JQuery编码
- 条件变量的细节问题
- linux内核网络参数somaxconn
- 图形学理论知识 BRDF 双向反射分布函数
- 删除归档
- 技能条的制作
- Java控制台实现计算器[面向对象思想-02]
- NodeJS学习笔记
- sql递归查询子级
- ios阻止锁屏 --老代码,供参考
- spring的懒加载
- tweentype
- Android -tool工具UIautomatorviewer提示“不能让屏幕黑屏”
- JVM、JRE与JDK简介