B3825 题解
FurippuWRY · · 题解
很简单,就是考察分支结构。
如果 Drizzle;
如果 Moderate Rain;
如果 Heavy Rain;
如果 Torrential Rain;
特别地,当 YES,否则输出 NO。若
#include <bits/stdc++.h>
using namespace std;
int x, h;
int main() {
cin >> x >> h;
if (x < 10) cout << "Drizzle";
else if (x >= 10 && x < 25) cout << "Moderate Rain";
else if (x >= 25 && x < 50) cout << "Heavy Rain";
else if (x >= 50) cout << "Torrential Rain";
if (h == 1) {
if (x >= 20) cout << '\n' << "YES";
else cout << '\n' << "NO";
}
return 0;
}