[计算机类试卷]国家三级(网络技术)机试模拟试卷234及答案与解析.doc

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

1、国家三级(网络技术)机试模拟试卷 234及答案与解析 一、程序设计题 1 已知在文件 IN DAT中存有若干个 (个数 #include #define MAX 200 int inBufMAX; int totleNum=0; *文件 IN DAT中共有多少个正整数 * int totleCnt=0; *符合条件的正整数的个数 * double totleAverage=0 0; 平均值 int ReadData(void); void WriteData(void); void findValue(void) void main() int i; system(“CLS“); for(i=

2、0; i0) 如果当前数大于零 totleNum+; 则将总个数加 1 for(j=0; j4; j+) temp; inBufi; 将要进行分解的数暂存入 temp中 for(k=0; kj; k+) temp; temp 10;求第 j位的值 d3-j=temp 10; 先将 temp除以 10的 J次方,再对其求余即可 ) if(d0+d1+d2+d3) 2=0) 如果各位数字之和是偶数 totleCnt+; l则使符合条件的计数器加 1 totleAverage=(totleAverage*(totleCnt-1)+inBufi) totleCnt; totleAverage*(tot

3、leCnt-1)得到的是前 (totleCnt-1)个数的总和 【试题解析】 本题主要考查数位分解及数据平均值的求法。本程序的步骤是;1将数值送入 temp中。 2数位分解,由 temp 10得到个位数; (temp 10)10得到十位数,依此类推,可得到各数位上的数值。 3按照题目所给的条件筛选出数据。 4对选出的数据求平均值,由于本题中的数据量比较大,若采用先将各个值加起来再除以总个数来取平均的话,变量不能存储那么大的数据而导致溢出。本程序采用的方法是; N个数的平均值 =前 (N-1)个数的平均值 *(N-1)+第 N个数 N,采用这种递推的方法就避免了将大的数据存入变量中而产生溢出。

展开阅读全文
相关资源
猜你喜欢
  • BS S 150-1975 Specification for chromium-molybdenum-vanadium-niobium heat-resisting steel billets bars forgings and parts (930-1080 MPa) (Cr 10 5 Mo 0 6 V 0 2 Nb 0 3)《铬-钼-钒-铌-耐热钢坯、棒材、锻件及零件规范(930-.pdf BS S 150-1975 Specification for chromium-molybdenum-vanadium-niobium heat-resisting steel billets bars forgings and parts (930-1080 MPa) (Cr 10 5 Mo 0 6 V 0 2 Nb 0 3)《铬-钼-钒-铌-耐热钢坯、棒材、锻件及零件规范(930-.pdf
  • BS PD ISO IEC TR 20000-12-2016 Information technology Service management Guidance on the relationship between ISO IEC 20000-1 2011 and service management frameworks CMMI-SVC 《信息技术 .pdf BS PD ISO IEC TR 20000-12-2016 Information technology Service management Guidance on the relationship between ISO IEC 20000-1 2011 and service management frameworks CMMI-SVC 《信息技术 .pdf
  • BS PD ISO IEC TR 20007-2014 Information technology Cultural and linguistic interoperability Definitions and relationship between symbols icons animated icons pictograms characters .pdf BS PD ISO IEC TR 20007-2014 Information technology Cultural and linguistic interoperability Definitions and relationship between symbols icons animated icons pictograms characters .pdf
  • BS PD ISO IEC TR 29110-5-1-3-2017 Systems and software engineering Lifecycle profiles for Very Small Entities (VSEs) Software engineering Management and engineering guide Generic p.pdf BS PD ISO IEC TR 29110-5-1-3-2017 Systems and software engineering Lifecycle profiles for Very Small Entities (VSEs) Software engineering Management and engineering guide Generic p.pdf
  • BS PD ISO IEC TR 29110-5-6-1-2015 Systems and software engineering Lifecycle profiles for Very Small Entities (VSEs) Systems engineering Management and engineering guide Generic pr.pdf BS PD ISO IEC TR 29110-5-6-1-2015 Systems and software engineering Lifecycle profiles for Very Small Entities (VSEs) Systems engineering Management and engineering guide Generic pr.pdf
  • BS PD ISO IEC TR 29110-5-6-2-2014 Systems and software engineering Lifecycle profiles for Very Small Entities (VSEs) Systems engineering Management and engineering guide Generic pr.pdf BS PD ISO IEC TR 29110-5-6-2-2014 Systems and software engineering Lifecycle profiles for Very Small Entities (VSEs) Systems engineering Management and engineering guide Generic pr.pdf
  • BS PD ISO IEC TS 17021-5-2014 Conformity assessment Requirements for bodies providing audit and certification of management systems Competence requirements for auditing and certifi.pdf BS PD ISO IEC TS 17021-5-2014 Conformity assessment Requirements for bodies providing audit and certification of management systems Competence requirements for auditing and certifi.pdf
  • BS PD ISO IEC TS 17021-6-2014 Conformity assessment Requirements for bodies providing audit and certification of management systems Competence requirements for auditing and certifi.pdf BS PD ISO IEC TS 17021-6-2014 Conformity assessment Requirements for bodies providing audit and certification of management systems Competence requirements for auditing and certifi.pdf
  • BS PD ISO IEC TS 17021-7-2014 Conformity assessment Requirements for bodies providing audit and certification of management systems Competence requirements for auditing and certifi.pdf BS PD ISO IEC TS 17021-7-2014 Conformity assessment Requirements for bodies providing audit and certification of management systems Competence requirements for auditing and certifi.pdf
  • 相关搜索

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

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