#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main(){
double x;
cin >>x;
if(0<=x && 5>x){
cout<<fixed<<setprecision(3)<< -1*x+2.5;
}else if(x<10){
cout<<fixed<<setprecision(3)<<2-1.5*pow((x-3),2);
}else if(x<20){
cout<<fixed<<setprecision(3)<<x/2.0-1.5;
}
return 0;
}
2023 9 30
最新推荐文章于 2024-09-16 15:03:26 发布