#include<bits/stdc++.h> using namespace std; int main() { double x,y; cin>>x; if (5>x && x>=0){ y=-x+2.5; } else if(10>x && x>=5){ y=2-1.5*(x-3)*(x-3); } else{ y=x/2-1.5; }
cout<<fixed<<setprecision(3)<<y; return 0; }
信我!
注册一个 个人测试记录 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 个人测试记录 通用账户