网站大量收购独家精品文档,联系QQ:2885784924

C语言题1.xls

  1. 1、本文档共4页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
C语言题1.xls

程序编程 程序改错 程序填空 选择题 ProgramingInfo #include conio.h #include stdio.h #include math.h double fun(int n) { double s, t; int i; ____________ t=1.0; for(i=1;i=n; i++) t=t*i/(2*i+1); ______________ return s; } main() {printf(\n %12.10lf, fun(25)); } 1.5707963218 下面的程序是求表达式的值: s=1+1/3+(1*2)/(3*5)+(1*2*3)/(3*5*7)+......+(1*2*3*......*n)/(3*5*7*......(2*n+1)) 请将程序补充完整,并给出当n=28时,程序的运行结果(按四舍五入保留10位小数) 程序: #include conio.h #include stdio.h #include math.h void fun(int n) { double s, t; int i; s=1.0; ___________________ for(i=1;i=n; i++) { t=t*i/(2*i+1); ___________ } return s; } main() {printf(\n %12.10lf, fun(28)); } 1.5707963262 以下程序求[1,800]之间能被3 或8整除的数之和。请将程序补充完整,并给出正确结果,填入相应窗口。 #include conio.h #include stdio.h #include math.h main() { __________ long sum; sum=0; for ( i=1;i=800;i++) { if (( fmod(i,3)==0)||(fmod(i,8)==0)) ______________ } clrscr(); printf(%ld\n,sum); } 133469 若某个整数N的所有因子之和等于N的倍数,则称N为多因子完备数。例如,28是多因子完备数。因为:1+2+4+7+14+28=56=28*2 ,求:[1,700]间有多少个多因子完备数,将下列程序补充完整,正确结果填入相应窗口。 程序: #include conio.h #include stdio.h #include math.h main() { int a,b,c,n,count=0; for (a=1; a=700; a++) { _____________ for (c=1;c=a;c++) if (a%c ==0) b=b+c; if (b%a==0) { _______________ } } printf(\n count = %d,count); } 若某个整数N的所有因子之和等于N的倍数,则称N为多因子完备数。例如,28是多因子完备数。因为:1+2+4+7+14+28=56=28*2 ,求:[10,800]间有多少个多因子完备数,将下列程序补充完整,正确结果填入相应窗口。 程序: #include conio.h #include stdio.h #include math.h main() { int a,b,c,n,count=0; for (a=10; a=800; a++) { _____________ for (c=1;c=a;c++) if (a%c ==0) b=b+c; if (b%a==0) { _______________ } } printf(\n count = %d,count); } 若某个整数N的所有因子之和等于N的倍数,则称N为多因子完备数。例如,28是多因子完备数。因为:1+2+4+7+14+28=56=28*2 ,求:[100,1000]间有多少个多因子完备数,将下列程序补充完整,正确结果填入相应窗口。 程序: #include conio.h #include stdio.h #include math.h main() { int a,b,c,n,count=0; for (a=100; a=1000; a++) { ______

文档评论(0)

gshbzl + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档