【计算机类职业资格】三级信息管理技术机试-216及答案解析.doc

上传人:sofeeling205 文档编号:1320686 上传时间:2019-10-17 格式:DOC 页数:3 大小:26KB
下载 相关 举报
【计算机类职业资格】三级信息管理技术机试-216及答案解析.doc_第1页
第1页 / 共3页
【计算机类职业资格】三级信息管理技术机试-216及答案解析.doc_第2页
第2页 / 共3页
【计算机类职业资格】三级信息管理技术机试-216及答案解析.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

1、三级信息管理技术机试-216 及答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.下列程序的功能是:设 A,B,C 为三个不为零的正整数,计算并输出下列不定方程组解的个数 cnt 以及满足此条件的所有 A,B,C 之和 sum。不定方程组为:A+B+C=13A-C=5请编写函数 countValue()实现程序的要求,最后调用函数 writeDat()把结果 cnt 和 sum 输出到文件out.dat 中。试题源程序#includestdiohvoid WriteDat();int cnt,sum:void countvalue()void

2、main()cnt=sum=0:countvalue();printf(“cnt=%d/n“,cnt);printf(“sum=%d/n“,sum);WriteDat();void WriteDat()FILE*fp;fp=fopen(“outdat“,“w“);fprintf(fp,“%d/n%d/n“,cnt,sum);fclose(fp);(分数:100.00)_三级信息管理技术机试-216 答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.下列程序的功能是:设 A,B,C 为三个不为零的正整数,计算并输出下列不定方程组解的个数 cnt

3、以及满足此条件的所有 A,B,C 之和 sum。不定方程组为:A+B+C=13A-C=5请编写函数 countValue()实现程序的要求,最后调用函数 writeDat()把结果 cnt 和 sum 输出到文件out.dat 中。试题源程序#includestdiohvoid WriteDat();int cnt,sum:void countvalue()void main()cnt=sum=0:countvalue();printf(“cnt=%d/n“,cnt);printf(“sum=%d/n“,sum);WriteDat();void WriteDat()FILE*fp;fp=fop

4、en(“outdat“,“w“);fprintf(fp,“%d/n%d/n“,cnt,sum);fclose(fp);(分数:100.00)_正确答案:(void countvalue()int a:for(a=6;a13;a+)if(18-2*a0)cnt+:sum+=13:)解析:解析 本题主要考查的是解方程问题。本题的难点和解题的关键在于分析题目,对于给定的方程组变形得到 B=18-2*A,C=A-50,因此 A 从 6 开始可能满足方程,而由第一个方程知道 A 不可能大于13,因此我们可以用 for 循环内嵌 if 语句来解出方程,如果 B0,那么此时的 A 就满足该方程组,cnt增 1,并且由第一个方程知道有一组解 sum 的值增加 13。

展开阅读全文
相关资源
猜你喜欢
  • EN 1069-2-2017 en Water slides - Part 2 Instructions.pdf EN 1069-2-2017 en Water slides - Part 2 Instructions.pdf
  • EN 107-1980 en Methods of Testing Windows Mechanical Tests《窗户的试验方法 机械试验》.pdf EN 107-1980 en Methods of Testing Windows Mechanical Tests《窗户的试验方法 机械试验》.pdf
  • EN 1071-1-2003 Advanced technical ceramics - Methods of test for ceramic coatings - Part 1 Determination of coating thickness by contact probe filometer《先进技术陶瓷 陶瓷覆层的试验方法 第1部分 用接触式探.pdf EN 1071-1-2003 Advanced technical ceramics - Methods of test for ceramic coatings - Part 1 Determination of coating thickness by contact probe filometer《先进技术陶瓷 陶瓷覆层的试验方法 第1部分 用接触式探.pdf
  • EN 1071-10-2009 en Advanced technical ceramics - Methods of test for ceramic coatings - Part 10 Determination of coating thickness by cross sectioning《先进技术陶瓷 陶瓷涂层的试验方法 第10部分 横剖面涂层厚.pdf EN 1071-10-2009 en Advanced technical ceramics - Methods of test for ceramic coatings - Part 10 Determination of coating thickness by cross sectioning《先进技术陶瓷 陶瓷涂层的试验方法 第10部分 横剖面涂层厚.pdf
  • EN 1071-12-2010 en Advanced technical ceramics - Methods of test for ceramic coatings - Part 12 Reciprocating wear test《高级工程陶瓷 陶瓷覆层试验方法 第12部分 往复摩擦磨损试验》.pdf EN 1071-12-2010 en Advanced technical ceramics - Methods of test for ceramic coatings - Part 12 Reciprocating wear test《高级工程陶瓷 陶瓷覆层试验方法 第12部分 往复摩擦磨损试验》.pdf
  • EN 1071-13-2010 en Advanced technical ceramics - Methods of test for ceramic coatings - Part 13 Determination of wear rate by the pin-on-disk method《高级工程陶瓷 陶瓷覆层试验方法 第13部分 磨损率销盘式试验》.pdf EN 1071-13-2010 en Advanced technical ceramics - Methods of test for ceramic coatings - Part 13 Determination of wear rate by the pin-on-disk method《高级工程陶瓷 陶瓷覆层试验方法 第13部分 磨损率销盘式试验》.pdf
  • EN 1071-2-2002 Advanced technical ceramics - Methods of test for ceramic coatings - Part 2 Determination of coating thickness by the crater grinding method《先进技术陶瓷 陶瓷涂层用试验方法 第2部分 用滴.pdf EN 1071-2-2002 Advanced technical ceramics - Methods of test for ceramic coatings - Part 2 Determination of coating thickness by the crater grinding method《先进技术陶瓷 陶瓷涂层用试验方法 第2部分 用滴.pdf
  • EN 1071-3-2005 en Advanced technical ceramics - Methods of test for ceramic coatings - Part 3 Determination of adhesion and other mechanical failure modes by a scratch test《先进技术陶瓷 .pdf EN 1071-3-2005 en Advanced technical ceramics - Methods of test for ceramic coatings - Part 3 Determination of adhesion and other mechanical failure modes by a scratch test《先进技术陶瓷 .pdf
  • EN 1071-4-2006 en Advanced technical ceramics - Methods of test for ceramic coatings - Part 4 Determination of chemical composition by electron probe microanalysis (EPMA)《先进技术陶瓷 陶瓷.pdf EN 1071-4-2006 en Advanced technical ceramics - Methods of test for ceramic coatings - Part 4 Determination of chemical composition by electron probe microanalysis (EPMA)《先进技术陶瓷 陶瓷.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1