解题思路:





注意事项:





参考代码:

#include<stdio.h>

#include<math.h>

int main()

{

    float x;

    scanf("%f",&x);

    if(x<0)

    {

        printf("%.2f\n",fabs(x));

    }

    else if(x<2)

    {

        printf("%.2f\n",sqrt(x+1));

    }

    else if(x<4)

    {

        printf("%.2f\n",pow((x+2),5));

    }

    else

    {

        printf("%.2f\n",2*x+5);

    }

    return 0;


    

}


 

0.0分

2 人评分

  评论区