[计算机类试卷]计算机三级网络技术机试(上机操作)模拟试卷44及答案与解析.doc

上传人:deputyduring120 文档编号:505705 上传时间:2018-11-29 格式:DOC 页数:2 大小:25KB
下载 相关 举报
[计算机类试卷]计算机三级网络技术机试(上机操作)模拟试卷44及答案与解析.doc_第1页
第1页 / 共2页
[计算机类试卷]计算机三级网络技术机试(上机操作)模拟试卷44及答案与解析.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、计算机三级网络技术机试(上机操作)模拟试卷 44及答案与解析 一、程序设计题 1 请编写函数 countValue()其功能是:计算出自然数 SIX和 NINE,它们满足的条件是 SIX+SIX+SIX=NINE+NINE的个数 count,以及满足此条件的所有 SIX与NINE的和 sum。最后调用函数 WriteData()把结果 count和 sum输出到文件OUT DAT中。其中, S, I, X, N, E各代表一个十进制数。 注意;部分源程序已给出。 请勿改动主函数 main()和写函数 WriteData()的内容。 试题程序: #include int count, sum;

2、void WriteData(); void countValue() void main() count=sum=0; countValue(); printf(“count= d n”, count); printf(“SIX+NINE= d n”, sum); writeData(); void WriteData() FILE*fp; fp=fopen(“OUT DAT”, “W”); fprintf(fp, “count= d nsum= d n”, count sum); fclose(fp); 计算机三级网络技术机试(上机操作)模拟试卷 44答案与解析 一、程序设计题 1 【正确

3、答案】 void countValue() int S, I, X, N, E, SIX, NINE; for(S=0; S=9; S+) 将 S, I, X, N, E进行循环穷举 for(I=0; I=9; I+) for(X=0; X=9; X+) for(N=0; N=9; N+) for(E=0; E=9; E+) SIX=100*s+10*I+x; SIX的计算方法 NlNE=1000*N+100*I+10*N+E; NINE的计算方法 if(3*S1X=2*NINE) count+; sum+=(SIX+NlNE); 【试题解析】 本题主要考查分解数据的重组以及用穷举法解方程的方法。 本题用穷举法 (即将 S, I, X, N, E分别从小到大代入验证 )即可很快得到所有的值。解谊题的关键是知道如何由各数位上的数字得到它们所组成的数字,解决这一问题的方法是将各教位上的数字乘以相应的权值再求和即可。即可这样编程: SIX=100*S+10*I+X; NlNE=1000*N+100*I+10*N+E。

展开阅读全文
相关资源
猜你喜欢
  • BS PAS 59-2014 Specification for collective fall arrest soft landing systems《互相连接着的缓冲垫构成的防跌落软着陆系统规范》.pdf BS PAS 59-2014 Specification for collective fall arrest soft landing systems《互相连接着的缓冲垫构成的防跌落软着陆系统规范》.pdf
  • BS PAS 61-2006 Determination of priority pollutants in surface water using passive sampling《用无源抽样法测定地表水中最先污染物》.pdf BS PAS 61-2006 Determination of priority pollutants in surface water using passive sampling《用无源抽样法测定地表水中最先污染物》.pdf
  • BS PAS 70-2003 HD clay bricks - Guide to appearance and site measured dimensions and tolerance《HD粘土砖 外观和现场测量尺寸和公差指南》.pdf BS PAS 70-2003 HD clay bricks - Guide to appearance and site measured dimensions and tolerance《HD粘土砖 外观和现场测量尺寸和公差指南》.pdf
  • BS PAS 85-2000 A quality management system to ensure the integrity and traceability of primary products in the agri-food chain《保证农业食品链中初级产品的完整性和可追踪性的质量管理体系》.pdf BS PAS 85-2000 A quality management system to ensure the integrity and traceability of primary products in the agri-food chain《保证农业食品链中初级产品的完整性和可追踪性的质量管理体系》.pdf
  • BS PAS 8621-2011 8125 Multipoint locking assemblies Keyless egress Performance requirements and test methods《多点锁定组件 无钥匙孔 性能要求和试验方法 》.pdf BS PAS 8621-2011 8125 Multipoint locking assemblies Keyless egress Performance requirements and test methods《多点锁定组件 无钥匙孔 性能要求和试验方法 》.pdf
  • BS PAS 92-2011 6875 Code of practice for the implementation of a biometric system《生物识别系统运行操作规范》.pdf BS PAS 92-2011 6875 Code of practice for the implementation of a biometric system《生物识别系统运行操作规范》.pdf
  • BS PAS 96-2010 0625 Defending food and drink Guidance for the deterrence detection and defeat of ideologically motivated and other forms of malicious attack on food and drink and .pdf BS PAS 96-2010 0625 Defending food and drink Guidance for the deterrence detection and defeat of ideologically motivated and other forms of malicious attack on food and drink and .pdf
  • BS PD 25111-2010 0625 PUBLISHED DOCUMENT nBusiness continuity nmanagement – Guidance on nhuman aspects of business ncontinuity《出版文献业务持续性管理 持续性管理的人类方向指南》.pdf BS PD 25111-2010 0625 PUBLISHED DOCUMENT nBusiness continuity nmanagement – Guidance on nhuman aspects of business ncontinuity《出版文献业务持续性管理 持续性管理的人类方向指南》.pdf
  • BS PD 25666-2010 Guidance on nexercising and testing for continuity and contingency nprogrammes《出版文献 业务连续性管理 连续性和应急事件规划的实施和检测指南》.pdf BS PD 25666-2010 Guidance on nexercising and testing for continuity and contingency nprogrammes《出版文献 业务连续性管理 连续性和应急事件规划的实施和检测指南》.pdf
  • 相关搜索

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

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