5 条题解

  • 3
    @ 2023-3-24 20:07:56
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        double n;
        cin >> n;
        if(n>=30)
        {
            cout << fixed << setprecision(1) << n*1.0;
        }
        else if(n>=20)
        {
            cout << fixed << setprecision(1) << n*1.2;
        }
        else if(n>=10)
        {
            cout << fixed << setprecision(1) << n*1.5;
        }
        else
        {
            cout << fixed << setprecision(1) << n*1.8;
        }
    }
    
    • 2
      @ 2023-1-9 22:31:35
      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
          int a;
          float b;
          cin >> a;
          if (a >= 30) b = a;
          else if (a >= 20) b = a * 1.2;
          else if (a >= 10) b = a * 1.5;
          else b = a * 1.8;
          cout << fixed << setprecision(1) << b;
          return 0;
      }
      
      • 1
        @ 2023-10-4 21:08:17
        #include <bits/stdc++.h>
        using namespace std;
        double n;
        int main()
        {
            cin >> n;
            if(n>=30)
            {
                n*=1.0;
            }
            else if(n>=20)
            {
                n*=1.2;
            }
            else if(n>=10)
            {
                n*=1.5;
            }
            else
            {
                n*=1.8;
            }
            cout<<fixed<<setprecision(1)<<n;
        }
        
        • 1
          @ 2023-9-18 21:50:15
          #include<bits/stdc++.h>
          using namespace std;
          int main()
          {
              double c;
              cin >> c;
              if(c < 10)
              {
                  c = c * 1.8;
                  printf("%.1f",c);
              }
              else if(c >= 10 && c <= 19)
              {
                  c = c * 1.5;
                  printf("%.1f",c);
              }
              else if(c >= 20 && c <= 29)
              {
                  c = c * 1.2;
                  printf("%.1f",c);
              }
              else
              {
                  c = c * 1.0;
                  printf("%.1f",c);
              }
              return 0;
          }
          

          原始算法 A

          • 1
            @ 2023-4-3 21:40:17
            #include<bits/stdc++.h>
            using namespace std;
            int main()
            {
                double x;
                cin>>x;
                if (x>=30)
                    cout<<x<<".0";//偷懒()
                else if (x>=20)
                    cout<<fixed<<setprecision(1)<<x*1.2;
                else if (x>=10)
                    cout<<fixed<<setprecision(1)<<x*1.5;
                else
                    cout<<fixed<<setprecision(1)<<x*1.8;
                return 0;
            }
            
            • 1

            【入门】冷饮的价格(2)

            信息

            ID
            301
            时间
            1000ms
            内存
            16MiB
            难度
            1
            标签
            递交数
            134
            已通过
            89
            上传者