68分求助
查看原帖
68分求助
1062216
LandyLanty楼主2024/4/4 12:02
#include<bits/stdc++.h>
using namespace std;
double f(int x){
    if(x<5) return -x+2.5;
    else if(x<10) return 2-1.5*(x-3)*(x-3);
    else return x/2-1.5;
}
int main(){
double n;cin>>n;
    printf("%.3f",f(n));
    return 0;
}
2024/4/4 12:02
加载中...