【计算机类职业资格】三级网络技术机试-78及答案解析.doc

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

1、三级网络技术机试-78 及答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.下列程序的功能是:计算出自然数 SIX 和 NINE,它们满足的条件是 SIX+SIX+SIX=NINE+NINE 的个数 cnt,以及满足此条件的所有 SIX 与 NINE 的和 sum。请编写函数 countValue()实现程序要求,最后调用函数 writeDAT()把结果 cnt 和 sam 输出到文件 OUT51.DAT 中。其中的 S,L X,N,I,N,E 各代表一个十进制数。注意:部分源程序已给出。请勿改动主函数 main()和写函数 writeDAT(

2、)的内容。试题程序:#includestdio. hint cnt, sum;void countValue()void main ()cnt=sum=O;countValue ();printf (“满足条件的个数=%d/n“, cnt);printf (“满足条件所有的 SIX 与 NINE 的和=%d/n“, sum);writeDAT ();writeDAT ( )FILE *fp;fp=fopen(“OUT51.DAT“, “w“);fprintf (fp, “%d/n%d/n“, cnt, sum);fclose (fp);(分数:100.00)_三级网络技术机试-78 答案解析(

3、总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.下列程序的功能是:计算出自然数 SIX 和 NINE,它们满足的条件是 SIX+SIX+SIX=NINE+NINE 的个数 cnt,以及满足此条件的所有 SIX 与 NINE 的和 sum。请编写函数 countValue()实现程序要求,最后调用函数 writeDAT()把结果 cnt 和 sam 输出到文件 OUT51.DAT 中。其中的 S,L X,N,I,N,E 各代表一个十进制数。注意:部分源程序已给出。请勿改动主函数 main()和写函数 writeDAT()的内容。试题程序:#include

4、stdio. hint cnt, sum;void countValue()void main ()cnt=sum=O;countValue ();printf (“满足条件的个数=%d/n“, cnt);printf (“满足条件所有的 SIX 与 NINE 的和=%d/n“, sum);writeDAT ();writeDAT ( )FILE *fp;fp=fopen(“OUT51.DAT“, “w“);fprintf (fp, “%d/n%d/n“, cnt, sum);fclose (fp);(分数:100.00)_正确答案:(void countValue()int i=100;wh

5、ile (1)if(3*i%2=0 /*统计满足条件的数的个数*/sum+=i+3*i/2; /*求满足上条件的所有 SIX 与 NINE 的和*/i+;else i+; /*如果果不满足条件,则取下一个数*/if(i999 II 3i/29999)break; /*当 SIXP 不为 3 位数或所得的数不为四位数时,退出循环*/ )解析:解析本题二查的知识点如下:(1)循环与判断的嵌套使用。(2)多条件的布尔运算。(3)“%”与“/”运算符的使用。根据题意,求的是满足 3 位数乘以 3 等于 4 位数乘以 2 的数的个数。我们可以使用循环结构对所有的 3 位数进行判断,若某个 3 位数乘以 3 整除 2 所得的数是 4 位整数,则这个 3 位数是满足条件的数。当判断的数不再是 3 位数或者进行处理后所得的数大于 9999,则要退出循环。在这里,还要注意判断结构中,各条件之间是用“与”运算还是用“或”运算。

展开阅读全文
相关资源
猜你喜欢
  • KS M ISO 5400-2012 Leather-Determination of total silicon content-Reduced molybdosilicate spectrometric method《皮革 硅总含量的测定 还原硅钼酸盐光谱测定法》.pdf KS M ISO 5400-2012 Leather-Determination of total silicon content-Reduced molybdosilicate spectrometric method《皮革 硅总含量的测定 还原硅钼酸盐光谱测定法》.pdf
  • KS M ISO 5423-2009 Moulded plastics footwear-Lined or unlined polyurethane boots for general industrial use-Specification《塑料模压套鞋 工业用加聚氨酯衬或不加聚氨酯衬的长统靴 规范》.pdf KS M ISO 5423-2009 Moulded plastics footwear-Lined or unlined polyurethane boots for general industrial use-Specification《塑料模压套鞋 工业用加聚氨酯衬或不加聚氨酯衬的长统靴 规范》.pdf
  • KS M ISO 5435-2012 Rubber compounding ingredients-Carbon black-Determination of tinting strength《橡胶复合材料 炭黑 着色强度的测定》.pdf KS M ISO 5435-2012 Rubber compounding ingredients-Carbon black-Determination of tinting strength《橡胶复合材料 炭黑 着色强度的测定》.pdf
  • KS M ISO 5470-2-2012 Rubber- or plastics-coated fabrics-Determination of abrasion resistance-Part 2:Martindale abrader《橡胶或塑料包覆纤维 磨损抗性的测定 第1部分 分磨损器》.pdf KS M ISO 5470-2-2012 Rubber- or plastics-coated fabrics-Determination of abrasion resistance-Part 2:Martindale abrader《橡胶或塑料包覆纤维 磨损抗性的测定 第1部分 分磨损器》.pdf
  • KS M ISO 5478-2010 Rubber-Determination of styrene content-Nitration method《橡胶 苯乙烯含量的测定 硝化法》.pdf KS M ISO 5478-2010 Rubber-Determination of styrene content-Nitration method《橡胶 苯乙烯含量的测定 硝化法》.pdf
  • KS M ISO 5751-1-2012 Motorcycle tyres and rims(metric series)-Part 1:Design guides《摩托车轮胎和轮辋(公制系列) 第1部分 设计指南》.pdf KS M ISO 5751-1-2012 Motorcycle tyres and rims(metric series)-Part 1:Design guides《摩托车轮胎和轮辋(公制系列) 第1部分 设计指南》.pdf
  • KS M ISO 5751-2-2007 Motorcycle tyres and rims(metric series)-Part 2:Tyre dimensions and load-carrying capacities《摩托车轮胎和轮辋(米制系列) 第2部分 载荷能力和轮胎尺寸》.pdf KS M ISO 5751-2-2007 Motorcycle tyres and rims(metric series)-Part 2:Tyre dimensions and load-carrying capacities《摩托车轮胎和轮辋(米制系列) 第2部分 载荷能力和轮胎尺寸》.pdf
  • KS M ISO 5771-2008 Rubber hose and hose assemblies for transferring anhydrous ammonia-Specification《输送无水氨用橡胶软管和软管组件》.pdf KS M ISO 5771-2008 Rubber hose and hose assemblies for transferring anhydrous ammonia-Specification《输送无水氨用橡胶软管和软管组件》.pdf
  • KS M ISO 5772-2008 Rubber hoses and hose assemblies for measured fuel dispensing-Specification.pdf KS M ISO 5772-2008 Rubber hoses and hose assemblies for measured fuel dispensing-Specification.pdf
  • 相关搜索

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

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