12 条题解

  • 4
    @ 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;
    }
    

    信息

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