#include <stdio.h>
#include <math.h>
int main()
{
double x,y;
scanf("%lf",&x);
if (x<0){
y=(x+1)*(x+1)+2*x+1/x;
}
else {
y=sqrt(x);
}
printf("%.2f",y);
return 0;
}
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交