kwrl.net
当前位置:首页 >> 用C语言. 请编写一个程序,功能是:计算并输出下列... >>

用C语言. 请编写一个程序,功能是:计算并输出下列...

#include int main() {int n=2,i; float sum=0; for(i=1;i

#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 void fun(int n) { int temp = 1; double sum = 0; int i; for (i=0;i

#include void main() { double sum,t,f,n; int k; sum=0; f=1; k=1; scanf("%lf",&n); do { t=f/(k*(k+1)+n); s+=t; k++; f*=(-1); } while ( fabs(t)>=0.0001 ); printf("k=%d,sum=%lf\n",k,sum); }

#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 > 100) printf("%d", x + 10); else if (x < -10) printf("%d", -x + 10); else printf("0"); return 0; }

#include double fun(double x){ double y; if(x 1 && x < 10) y = 2.0 * x - 1; else y = 3.0 * x - 11; return y;}// For Testint main(){ double x, y; printf("Input X:"); scanf("%lf", &x); y = fun(x); printf("y=f(x)=%lf", y); return 0;}

#include void main() { float c,f; printf("\n请输入华氏温度(F):"); scanf("%f",&f); c=(f-32)*5/9; printf("\n华氏温度 %1.2f 对应的摄氏温度为: %1.2f\n",f,c); } 扩展资料: 编程的执行原理 计算机对除机器语言以外的源程序不能直接识别、...

没什么大问题. 程序中都帮你改过来了.就是一些形式在数学上可以简写,在程序中必须完整的表达清楚. #include void main() { int x,y; scanf("%d",&x); if(x

#include int main() { double F = 0; printf("请输入F的值:\n"); scanf("%lf", &F); printf("C = %0.2lf\n", 5*(F-32)/9); return 0; } 运行结果:

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