hsfl.net
当前位置:首页 >> 帮帮忙,C语言题目输入一个x,输出下面分段函数F(x... >>

帮帮忙,C语言题目输入一个x,输出下面分段函数F(x...

#include float fun(float x){if(x>0) return 1;else if(x==0) return 0;else return -1;}int main(){float x;scanf("%f",&x);printf("%f",fun(x));return 0;}

#include #include void main() { float x,y; printf("input x:"); scanf("%f",&x); if(x>=0) y=x*x-2; else y=sqrt(5-x); printf("y=%f\n",y); }

# include # include void s (float i, float j) { if (i

scanf(“%f”,&x)的意思是用户输入的数是一个小数(浮点数),将接收到得用户输入存入变量x中。 float表示浮点数,也就是小数。float x,y的原因是满足x > 0或x

#include#includeint main(){ double x, y; scanf ("%lf", &x); if (x > 0)y = sqrt(2*x); else if (x < 0)y = 1.0/(3*exp(x)); else y = 0; printf ("%.2f\n", y); return 0;}

#include fun(float x) { int y; if(x>0) y=1; else if(x

printf("输入X");可以用汉文在C语言编辑中吗 y=x+2*√x+10;看不懂是√

如下: #include #include int main() { float x, result; printf("请输入x的值:"); scanf("%f",&x); if(x

#include#includevoid main(){float x,y;scanf("%f",&x);if(x>0)y=sin(x);else if(x==0)y=99;elsey=cos(x);print("%f",y);}

# include # include int main(void) { int x,y; printf("请输入x的值:\n"); scanf("%d",&x); if(x

网站首页 | 网站地图
All rights reserved Powered by www.hsfl.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com