16分蒟蒻,求求大佬
查看原帖
16分蒟蒻,求求大佬
1267066
yi18600361898楼主2024/3/2 22:00
#include <bits/stdc++.h>
using namespace std;
int main(){
    double x;
    double y;
    if(x>=0 and x<5){
        y=-1*x+2.5;
    }
    else if(x>5 and x<10){
        y=-2-1.5*(x-3)*(x-3);
    }
    else if(x>=10 and x<20){
        y=x/2-1.5;
    }
	cout<<fixed<<setprecision(3)<<y;
    return 0;
}
2024/3/2 22:00
加载中...