1 条题解

  • 1
    @ 2025-1-29 20:56:32

    主要考察分支语句,分清楚逻辑关系就行了。

    #include <bits/stdc++.h>
    #define endl '\n'
    
    using namespace std;
    
    typedef long long ll;
    
    int main() {
    	int x, h;
    	bool f = false;
    	cin >> x >> h;
    	if (h == 1) {
    		f = true;
    	}
    	if (x < 10)
    		cout << "Drizzle" << endl;
    	else if (x >= 10 && x < 25)
    		cout << "Moderate Rain" << endl;
    	else if (x >= 25 && x < 50)
    		cout << "Heavy Rain" << endl;
    	else if (x >= 50)
    		cout << "Torrential Rain" << endl;
    	if (f) {
    		if (x >= 20) {
    			cout << "YES" << endl;
    		} else
    			cout << "NO" << endl;
    	}
    	return 0;
    }
    
    • 1

    信息

    ID
    4841
    时间
    1000ms
    内存
    128MiB
    难度
    1
    标签
    递交数
    9
    已通过
    1
    上传者