9 条题解

  • 3
    @ 2021-12-5 19:11:08

    直接上代码,有空更新题解

    #include <iostream>
    #include <stdio.h>
    using namespace std;
    
    int main()
    {
        double x,y;
    
        cin>>x;
        if(0<=x&&x<5){
            y=-x+2.5;
        }
        else if(5<=x&&x<10){
            y=2-1.5*(x-3)*(x-3);
        }
        else {
        y=x/2-1.5;
        }
        printf("%.3f",y) ;
        return 0;
    }
    
    • 0
      @ 2024-4-19 20:07:03
      #include <iostream>
      #include <stdio.h>
      using namespace std;
      
      int main()
      {
          double x,y;
      
          cin>>x;
          if(0<=x&&x<5){
              y=-x+2.5;
          }
          else if(5<=x&&x<10){
              y=2-1.5*(x-3)*(x-3);
          }
          else {
          y=x/2-1.5;
          }
          printf("%.3f",y) ;
          return 0;
      }
      
      • 0
        #include <bits/stdc++.h>
        using namespace std;
        const int N=1e7+10;
        const int INF=0x3f3f3f3f;
        int main()
        {
        	double x,y;
        	cin>>x;
        	if(0<=x&&x<5)
        	{
        		y=-x+2.5;
        	}
        	else if(5<=x&&x<10)
        	{
        		y=2-1.5*(x-3)*(x-3);
        	}
        	else if(10<=x&&x<20)
        	{
        		y=x/2-1.5;
        	}
        	cout<<fixed<<setprecision(3)<<y;
        	return 0;
        }
        
        • 0
          @ 2022-9-27 17:37:34

          #include <iostream> #include <iomanip> using namespace std; int main(){ double n; cin>>n; if(0<=n&&n<5) n=-n+2.5; else if(5<=n&&n<10) n=2-1.5*(n-3)*(n-3); else n=n/2-1.5; cout<<fixed<<setprecision(3)<<n<<endl; return 0; }

          • -1
            @ 2022-9-27 17:36:50

            #include <iostream> #include <iomanip> using namespace std; int main(){ double n; cin>>n; if(0<=n&&n<5) n=-n+2.5; else if(5<=n&&n<10) n=2-1.5*(n-3)*(n-3); else n=n/2-1.5; cout<<fixed<<setprecision(3)<<n<<endl; return 0; }

            • -1
              @ 2022-9-27 17:36:37

              #include <iostream> #include <iomanip> using namespace std; int main(){ double n; cin>>n; if(0<=n&&n<5) n=-n+2.5; else if(5<=n&&n<10) n=2-1.5*(n-3)*(n-3); else n=n/2-1.5; cout<<fixed<<setprecision(3)<<n<<endl; return 0; }

              • -1
                @ 2022-8-12 21:32:37
                #include<bits/stdc++.h>
                #include <iostream>
                #include <iomanip>
                using namespace std;
                int main(){
                    double n;
                    cin>>n;
                    if(0<=n&&n<5)
                        n=-n+2.5;
                    else if(5<=n&&n<10)
                        n=2-1.5*(n-3)*(n-3);
                    else
                        n=n/2-1.5;
                    printf("%.3lf",n);
                    return 0;
                }
                
                • -2
                  @ 2022-1-23 13:49:03
                  #include <iostream>
                  #include <iomanip>
                  using namespace std;
                  int main(){
                      double n;
                      cin>>n;
                      if(0<=n&&n<5)
                          n=-n+2.5;
                      else if(5<=n&&n<10)
                          n=2-1.5*(n-3)*(n-3);
                      else
                          n=n/2-1.5;
                      cout<<fixed<<setprecision(3)<<n<<endl;
                      return 0;
                  }
                  • -4
                    @ 2022-2-9 11:16:45

                    ggf nj

                    • 1

                    信息

                    ID
                    856
                    时间
                    1000ms
                    内存
                    128MiB
                    难度
                    4
                    标签
                    递交数
                    391
                    已通过
                    194
                    上传者