3 solutions

  • 0
    @ 2026-3-17 20:02:58
    #include <bits/stdc++.h>
    using namespace std;
    int main() {
    	int a;
    	cin >> a;
    	if (a <= 10) {
    		cout << fixed << setprecision(2) << a * 0.8+0.2;
    	} else if (a > 10 && a <= 20) {
    		cout << fixed << setprecision(2) << (a-10) * 0.75 +10*0.8+0.2;
    	} else if (a > 20 && a <= 30) {
    		cout << fixed << setprecision(2) << (a-20)*0.7+10*0.75+10*0.8+0.2;
    	} else {
    		cout << "Fail";
    	}
    	return 0;
    }
    

    Information

    ID
    144
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    7
    Tags
    # Submissions
    305
    Accepted
    63
    Uploaded By