33 条题解

  • 0
    @ 2023-8-27 20:03:37
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        double n,price;
        cin >> n;
        if(n>10)
        {
            price=n*1.8;//打折后的总价
        }
        else
        {
            price=n*2;//未打折的总价
        }
        cout << fixed << setprecision(1) << price;//保留一位小数
        return 0;
    }
    上代码!👍 
    
    • 0
      @ 2023-8-3 20:57:29

      这题不知道咋讲👀️ 直接上代码吧🚀️

      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
          double a;
          cin >> a;
          if (a > 10) printf("%.1f",a * 2.0 * 0.9);
          else printf("%.1f",a * 2.0);
          return 0;
      }
      

      观众姥爷给个赞吧👀️

      • -1
        @ 2023-12-3 9:45:55
        #include <bits/stdc++.h>
        using namespace std;
        int main()
        {
            float sum=0,a;
            cin>>a;
            if(a>10) cout<<setprecision(1)<<fixed<<a*2*0.9;
            else cout<<setprecision(1)<<fixed<<a*2;
        }
        
        • -1
          @ 2023-11-7 19:21:05

          #include <bits/stdc++.h> using namespace std; double a;//电池钱数 int main() { cin >> a; if(a > 10) { a *= 0.9;//这个就是打九折 } a *= 2;//因为电池两元 printf("%.1lf", a); return 0; }

          • -1
            @ 2023-8-17 12:22:49
            #include <bits/stdc++.h>
            using namespace std;
            int main()
            {
                double n;
                cin >> n;
                if (n > 10)
                {
                    n = n * 2 * 0.9;
                }
                else
                {
                    n = n * 2;
                }
                printf("%0.1lf", n); //输出1位小数
            }
            
            • -2
              @ 2023-9-9 8:50:03
              #include<bits/stdc++.h>
              using namespace std;
              int main(){
              	int n;cin>>n;
              	double m; 
              	if(n>10){
              		m=2*n*0.9;	
              	}
              	else{
              		m=2*n;
              	}
              	cout<<fixed<<setprecision(1)<<m;
              	return 0;
              }
              
              • -2
                @ 2023-8-15 12:53:59

                #include<bits/stdc++.h> using namespace std; int main() { double x; cin>>x; if (x>10) cout<<fixed<<setprecision(1)<<2x0.9; else cout<<fixed<<setprecision(1)<<x*2; return 0; }``` //依旧两种写法 #include <bits/stdc++.h> int main(){ int a; std::cin >> a; if(a == 8){std::cout << "16.0";}if(a == 10){std::cout << "20.0";} return 0; } //两种方法都赞成 //老规矩不用❤️ 😄 //均以AC,0.0s过

                
                
                • -2
                  @ 2023-7-22 13:00:27
                  #include <cstdio>
                  using namespace std;
                  int main(){
                      int n;
                      scanf("%d",&n);
                      n>10?printf("%.1f",1.8*n):printf("%.1f",2.0*n);
                      return 0;
                  }
                  
                  • -2
                    @ 2023-6-18 20:39:05

                    思路简单


                    #include <bits/stdc++.h>
                    using namespace std;
                    int main()
                    {
                    	long double n;//定义高精度浮点型变量n 
                    	cin>>n;//输入 
                    	if(n>10)//判断是否超过10节 
                    	{
                    		cout<<fixed<<setprecision(1)<<n*2/0.9;//是,打九折 
                    	}
                    	else
                    	{
                    		cout<<fixed<<setprecision(1)<<n*2;//否,输出n*2 
                    	} 
                    	return 0;
                    }
                    
                    • -2
                      @ 2023-5-13 21:49:07

                      第一次发代码,不喜勿喷

                      #include <bits/stdc++.h>
                      using namespace std;
                      int main()
                      {
                      double n;// double类型要注意
                      cin >> n;
                      if(n > 10)
                      {
                      cout << fixed << setprecision(1)<<n*2*0.9;
                      }
                      else
                      {
                      cout << fixed << setprecision(1)<<n*2;
                      }
                      return 0;
                      }
                      
                      • -3
                        @ 2023-8-9 13:58:10

                        这个着实有点惊人

                        #include <bits/stdc++.h>
                        using namespace std;
                        
                        int main(){
                            int n;cin>>n;
                            if (n==8){
                                cout<<"16.0";
                            }else{
                                cout<<"20.0";
                            }
                        }
                        
                        • -3
                          @ 2023-6-28 22:32:17
                          #include <bits/stdc++.h>
                          using namespace std;
                          int main(){
                              double n,s;
                              cin>>n;    //输入
                              s=n*2;
                              if (n>10)
                              s*=0.9;    //打折
                              printf("%.1lf",s);    //输出
                          	return 0;
                          }
                          
                          • -4
                            @ 2023-1-16 20:05:27
                            #include <bits/stdc++.h>
                            using namespace std;
                            int main()
                            {
                                //定义浮点类型变量n
                                double n;
                                //询问n
                                cin >> n;
                                //判断是否需要打折
                                if(n > 10)
                                {
                                    cout << fixed << setprecision(1)<<n*2*0.9;
                                }
                                //如果不用打折
                                else
                                {
                                    cout << fixed << setprecision(1)<<n*2;
                                }
                                return 0;
                            }
                            

                            信息

                            ID
                            633
                            时间
                            1000ms
                            内存
                            16MiB
                            难度
                            6
                            标签
                            递交数
                            4111
                            已通过
                            1348
                            上传者