第三题 输入x后,根据下式计算并输出y值。

#include<stdio.h>
#include<math.h> 
int main(void)
{
    double x,y;
    printf("enter x:");
    scanf("%lf",&x);

    if(x<-2)
        y=x*x;
    if(x>2)
        y=sqrt(x*x+x+1);
    else
        y=x+2;
    printf("%lf",y);
    return 0;
}
原文地址:https://www.cnblogs.com/chcb/p/3398522.html