您的位置:首页 > 其它

杭电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

#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");
}



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: