编辑代码

#include<stdio.h>
#include<math.h>
main()
{
    float x,y;
    printf("请输入x的值\n");
    scanf("%f",&x);
    if(x>(-5)&&x<0)
    {y=2*x*x*x;
    printf("y的值为%f\n",y);}
    if(x>0&&x<=10)
    {y=sqrt(x)*(-2);
      printf("y的值为%f\n",y);}
    if(x==0)
    {y=x-1;
    printf("y的值为%f\n",y);}
    if(x<=(-5)||x>=10)
    {printf("y不存在\n");}
}