练习7第三题

it2026-08-11  8

#include<stdio.h> #include<math.h> int main(void) { double y,x; y=0; printf("输入x:"); scanf("%lf",&x); if(x>2){ y=y+sqrt(x*x+x+1); } else if((x>=-2)&&(x<=2)){ y=y+2+x; } else{ y=y+x*x; } printf("y=%.3f",y); return 0; }

 

转载于:https://www.cnblogs.com/liruijia199531/p/3398583.html

相关资源:数据结构—成绩单生成器
最新回复(0)