PTA7-4 计算分段函数[2] (10分) #include<stdio.h> #include<math.h>//调用数学函数库 int main() { double x; double pow(double x,double y);//pow函数求幂 scanf("%lf",&x); if(x>=0) { printf("f(%.2lf) = %.2lf",x,pow(x,0.5)); } else{ printf("f(%.2lf) = %.2lf",x,x*x+4*x+1+1/x); } }