3 solutions

  • 2
    @ 2026-1-23 12:15:44

    需要全部Copy的说一下,有时间我发。

    • 2
      @ 2026-1-23 12:11:03

      #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;
      

      }

      • 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;
        }
        
        • 1

        Information

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