分段计算即可
#include <stdio.h>
#include <math.h>
main( )
{
double x,y;
scanf("%lf",&x);
if(x>7)
y=2+sqrt(x);
else if(x<-7)
y=3*x*x;
else
y=5+3*x;
printf("%lf",y);
}
if.else..分支判断
scanf("%lf",&x);
if(x>7)
y=2+sqrt(x);
else if(x<-7)
y=3*x*x;
else
y=5+3*x;