Run ID:104467

提交时间:2025-01-05 10:36:52

#include<iostream> #include<cmath> #include<iomanip> using namespace std; int main(){ double x; cin>>x; double y; if(0<=x&&x<2){ y=1/(x+1); }else if(2<=x&&x<4){ y=x*x; }else{ y=sqrt(x); } cout<<fixed<<setprecision(3)<<y<<endl return 0; }