Run ID:1918

提交时间:2023-12-02 16:42:37

#include<iostream> #include<iomanip> using namespace std; int main() { double x,y,z; cin>>x; y=x-5; z=x-10; if(x>=0&&x<=20){ if(x<5){ x=-x+2.5; } else if(x>=5&&x<10){ x=(2-1.5*(y-3)*2)+-5+2.5; } else{ x=(z/2-1.5)+(2-1.5*(10-3)*2)+-5+2.5; } } cout<<fixed<<setprecision(3)<<x; return 0; }