循环和函数(补充).docVIP

  • 1
  • 0
  • 约3.3千字
  • 约 6页
  • 2020-10-09 发布于山东
  • 举报
一、程序填空题 #include stdio.h double fun(double e) { int i; double s, x; /**********found**********/ s=0; i=__1__; x=1.0; while(xe){ /**********found**********/ __2__; /**********found**********/ x=(2.0*i-1)/((__3__)*(2.0*i)); s=s+x; } return s; } main() { double e=1e-3; printf(\nThe result is: %f\n,fun(e)); } #include stdio.h int fun(int x) { int n, s1, s2, s3, t; /**********found**********/ n=__1__; t=100; /**********found**********/ while(t=__2__) { s1=t%10; s2=(t/10)%10; s3=t/100; if(s1+s2+s3==15) { printf(%d ,t); n++; } /******

文档评论(0)

1亿VIP精品文档

相关文档