【题意】:一个高168英尺的船(或者类似的),是否能撞上高为a,b,c的underpasses。思路:三个数比较大小,理解题意就行。
【代码:AC】
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <cstdio>
using namespace std;
int main()
{
const int s = 168;
int a = 0, b = 0, c = 0;
while (cin >> a >> b >> c)
{
if (a < s)
cout << "CRASH " << a << endl;
else if (b < s)
cout << "CRASH " << b << endl;
else if (c < s)
cout << "CRASH " << c << endl;
else
cout << "CRASH NO CRASH" << endl;
}
return 0;
}