首页 c语言实验报告。1000以内最大的10个素数以及求和

c语言实验报告。1000以内最大的10个素数以及求和

举报
开通vip

c语言实验报告。1000以内最大的10个素数以及求和c语言实验报告。1000以内最大的10个素数以及求和 C语言程序设计实验报告 实验名称 循环控制语句 学 院 材料与冶金学院 专业班级 新能源1101 姓 名 汪爽 学 号 20110558 任课教师 柳秀梅 实验时间 2011年10月13日 1 实验目的 (1)熟练掌握while语句、do-while语句和for语句格式及使用方法,掌握三种 循环控制语句的循环过程以及循环结构的嵌套,利用三种循环语句实现循环结 构; (2)掌握简单、常用的算法,并在编程过程中体验各种算法的编程技巧; (3)进一步学...

c语言实验报告。1000以内最大的10个素数以及求和
c语言实验报告。1000以内最大的10个素数以及求和 C语言程序 设计 领导形象设计圆作业设计ao工艺污水处理厂设计附属工程施工组织设计清扫机器人结构设计 实验报告 实验名称 循环控制语句 学 院 材料与冶金学院 专业班级 新能源1101 姓 名 汪爽 学 号 20110558 任课教师 柳秀梅 实验时间 2011年10月13日 1 实验目的 (1)熟练掌握while语句、do-while语句和for语句格式及使用方法,掌握三种 循环控制语句的循环过程以及循环结构的嵌套,利用三种循环语句实现循环结 构; (2)掌握简单、常用的算法,并在编程过程中体验各种算法的编程技巧; (3)进一步学习调试程序,掌握语法错误和逻辑错误的检查方法。 2 实验 内容 财务内部控制制度的内容财务内部控制制度的内容人员招聘与配置的内容项目成本控制的内容消防安全演练内容 输出1000以内的最大10个素数以及它们的和。 3 算法描述 流程 快递问题件怎么处理流程河南自建厂房流程下载关于规范招聘需求审批流程制作流程表下载邮件下载流程设计 图 a few members of the team cadres quality is not strong, a lot of things a few leading cadres as muddle along; wind float, in the specific work not burden, dare not touch, in the work "Dragonfly" phenomenon, keen to engage in formalism, do not further, not specious writing, seek practical results, sense of responsibility is not strong. Such as production safety supervision and management work, the strict requirements, heavy task, individual 开始 声明变量k,m,i=2,a[n],s=0,m=999,n=1; k=sqrt(m) m=m-2 是 m%i=0, 否 i=i+1 是 i<=k? 否 是 n<=10a[n]=m, n=n+1 ? 否 n=1 s=s+a[n] n=n+1 是 n<10? 否 输出 s=a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+ a[8]+a[9]+a[10] 结束 a few members of the team cadres quality is not strong, a lot of things a few leading cadres as muddle along; wind float, in the specific work not burden, dare not touch, in the work "Dragonfly" phenomenon, keen to engage in formalism, do not further, not specious writing, seek practical results, sense of responsibility is not strong. Such as production safety supervision and management work, the strict requirements, heavy task, individual 4 源程设计 #include #include main() { int m,i,k,a[10],n=1,s=0; for(m=999;;m=m-2) { k=(int)sqrt(m); for(i=2;i<=k;i++) if(m%i==0) break; if(i>=k+1) {a[n]=m; n++; s=s+m; } if(n>=11) break; } printf("%d+%d+%d+%d+%d+%d+%d+%d+%d+%d=%d\n", a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],s); } 5 测试数据 1000 6 运行结果 a few members of the team cadres quality is not strong, a lot of things a few leading cadres as muddle along; wind float, in the specific work not burden, dare not touch, in the work "Dragonfly" phenomenon, keen to engage in formalism, do not further, not specious writing, seek practical results, sense of responsibility is not strong. Such as production safety supervision and management work, the strict requirements, heavy task, individual 7 出现问题及解决方法 (1)对c语言编程不熟练,导致编程很是困难,经过认真地学习课本的内容和做实验后编程有 所改善。 (2)实验的过程中会忘记声明变量,得认真地检查发现问题。 (3)判断素数的程序编写错误,在同学的帮忙下得以解决。 .8实验心得 (1) 通过实验我对c语言的编程语言更加熟悉,加快编程输入语言的速度。 (2) 对for语句格式及使用方法了解的清楚了点,掌握三种循环控制语句的循 环过程以及循环结构的嵌套,利用三种循环语句实现循环结构。 (3) 再次让我明白做实验时要细心,认真检查。 a few members of the team cadres quality is not strong, a lot of things a few leading cadres as muddle along; wind float, in the specific work not burden, dare not touch, in the work "Dragonfly" phenomenon, keen to engage in formalism, do not further, not specious writing, seek practical results, sense of responsibility is not strong. Such as production safety supervision and management work, the strict requirements, heavy task, individual
本文档为【c语言实验报告。1000以内最大的10个素数以及求和】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_650122
暂无简介~
格式:doc
大小:23KB
软件:Word
页数:5
分类:生活休闲
上传时间:2017-10-19
浏览量:120