【计算机类职业资格】计算机三级(网络技术)上机考试3及答案解析.doc

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

1、计算机三级(网络技术)上机考试 3 及答案解析(总分:-1.00,做题时间:90 分钟)1.已知在文件 IN13.DAT 中存有若干个(个数 #include #define MAXNUM 200 int xxMAXNUM; int totNum = 0; /* 文件 IN13.DAT 中共有多少个正整数 */ int totCnt = 0; /* 符合条件的正整数的个数 */ double totPjz = 0.0; /* 平均值 */ int ReadDat(void); void Writedat(void); void CalValue(void) main() int i; clrs

2、cr(); for(i = 0; i 1; /*将数右移一位*/ if (data%2=0) /*如果右移 1 位后,产生的新数是偶数*/ totCnt+; totPjz+=xxi; /*统计这些数的个数,并将满足条件的原数求和*/ totPjz/=totCnt; /*求满足条件的这些数(右移前的值)的算术平均值*/ )解析:本题的解题思路是首先利用一个 for 循环来依次从数组中取得各数,由于题目要求数组中正整数的个数,因此,零不做任何处理,接着去取下一个数。只要某数大于零,则该数一定是正整数,这时就给变量 totNum(正整数的个数)累加 1,之后把该正整数右移一位后的结果临时保存在变量 data 中,再对这个临时变量进行是否偶数的判断。如果该临时变量中保存的值是偶数,则表明原数符合条件,就给变量totCnt(符合判断条件的正整数个数)累加 1,并把当前的变量 data 右移前的原数的值累加到变量totPjz 中,当所有符合判断条件的数都被找出后,再对 totPjz 进行求平均值的计算。

展开阅读全文
相关资源
猜你喜欢
  • BS PD CEN TR 15858-2009 Construction products n— Assessment of the nrelease of regulated ndangerous substances nfrom construction nproducts based on nthe WT WFT FT nproced.pdf BS PD CEN TR 15858-2009 Construction products n— Assessment of the nrelease of regulated ndangerous substances nfrom construction nproducts based on nthe WT WFT FT nproced.pdf
  • BS PD CEN TR 15868-2009 9375 Survey of national nrequirements used in nconjunction with EN n206-1 2000《需要与EN 206-1 2000标准一起使用的各国要求调查》.pdf BS PD CEN TR 15868-2009 9375 Survey of national nrequirements used in nconjunction with EN n206-1 2000《需要与EN 206-1 2000标准一起使用的各国要求调查》.pdf
  • BS PD CEN TR 15872-2014 Health informatics Guidance on patient identification and cross-referencing of identities《健康信息学 患者识别和身份交叉引用指南》.pdf BS PD CEN TR 15872-2014 Health informatics Guidance on patient identification and cross-referencing of identities《健康信息学 患者识别和身份交叉引用指南》.pdf
  • BS PD CEN TR 15874-2009 3750 Railway applications n— Noise emission — nRoad test of standard nfor rail roughness nmeasurement EN n15610 2009《轨道交通 噪声排放 铁轨粗糙度测量用公路标准试验EN 15610-2009》.pdf BS PD CEN TR 15874-2009 3750 Railway applications n— Noise emission — nRoad test of standard nfor rail roughness nmeasurement EN n15610 2009《轨道交通 噪声排放 铁轨粗糙度测量用公路标准试验EN 15610-2009》.pdf
  • BS PD CEN TR 15894-2009 Building hardware - Door fittings for use by children elderly and disabled people in domestic and public buildings - A guide for specifiers 《建筑五金件.pdf BS PD CEN TR 15894-2009 Building hardware - Door fittings for use by children elderly and disabled people in domestic and public buildings - A guide for specifiers 《建筑五金件.pdf
  • BS PD CEN TR 15913-2009 Spectator facilities n— Layout criteria nfor viewing area for nspectators with special nneeds《观众设施 有特殊需要观众观赏区域的布置标准》.pdf BS PD CEN TR 15913-2009 Spectator facilities n— Layout criteria nfor viewing area for nspectators with special nneeds《观众设施 有特殊需要观众观赏区域的布置标准》.pdf
  • BS PD CEN TR 15917-2009 Textiles — nCosmetotextiles《纺织品 美容纺织品》.pdf BS PD CEN TR 15917-2009 Textiles — nCosmetotextiles《纺织品 美容纺织品》.pdf
  • BS PD CEN TR 15932-2010 Plastics — nRecommendation nfor terminology and ncharacterisation of nbiopolymers and nbioplastics《塑料 生物高分子和生物塑料的术语和特征推荐性规程 》.pdf BS PD CEN TR 15932-2010 Plastics — nRecommendation nfor terminology and ncharacterisation of nbiopolymers and nbioplastics《塑料 生物高分子和生物塑料的术语和特征推荐性规程 》.pdf
  • BS PD CEN TR 15941-2010 Sustainability of construction nworks — Environmental nproduct declarations — nMethodology for selection and use of generic data《建筑工程的可持续性 环境产品声明 通.pdf BS PD CEN TR 15941-2010 Sustainability of construction nworks — Environmental nproduct declarations — nMethodology for selection and use of generic data《建筑工程的可持续性 环境产品声明 通.pdf
  • 相关搜索

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

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