供参考:
#include <stdio.h>
#include <math.h>
int main()
{
int x;
double y;
scanf("%d", &x);
if (x<0 && x>-10)
y = x + 1;
else if (x == 0)
y = x - 1;
else if (x > 0 && x < 10)
y = sqrt(x);
printf("%f", y);
return 0;
}