zpxc.net
当前位置:首页 >> C语言编程: 输入x的值,按下面公式计算并输出y的值... >>

C语言编程: 输入x的值,按下面公式计算并输出y的值...

#includeint main(){int x,y;printf("输入x的值:"); scanf("%d",&x);if(x1&&x=10)y=3*x-11;printf("y=%d\n",y);return 0;}

#include #include int main ( ) { double x,y; printf("input x:"); scanf("%lf",&x); if (x=10) y= sqrt( 3*x-4); else y=2*x*x-1; printf("y=%8.3f\n",y); return 0; }

#include "stdio.h" int main(void) { int x; scanf("%d", &x); if (x > 100) printf("%d", x + 10); else if (x < -10) printf("%d", -x + 10); else printf("0"); return 0; }

Private Sub Command1_Click()Dim x As DoubleDim y As Doublex = Val(InputBox("请输入x的值"))Select Case x Case Is > 3 y = x + 3 Case 1 To 3 y = x ^ 2 Case 0 To 1 y = Sqr(x) Case Is

y = pow(a,5) + sin(a*x) + log(a+x) +pow(e,a*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 "stdio.h" int main(void) { int x; scanf("%d", &x); if (x > 0) printf("1"); else if (x == 0) printf("0"); else printf("-1"); return 0; }

#include int main(){float x,y;printf("请输入X=");scanf("%f",&x);y=2*x*x-10+12.5;printf("Y=%.2f",y);return 0;}

#include int main(void){ int x,y; printf("please put x:"); scanf("%d",&x); if(x=-2&&x5) y=3*x+6; printf("y= %d\n",y); return 0;}

#include #include #include int main() { double x,y; printf("x="); scanf("%lf",&x); y = sin(x); printf("y=%lf",y); getch(); }

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