【计算机类职业资格】国家三级(网络技术)机试-试卷12及答案解析.doc

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

1、国家三级(网络技术)机试-试卷 12 及答案解析(总分:2.00,做题时间:90 分钟)一、程序设计题(总题数:1,分数:2.00)1. (分数:2.00)_国家三级(网络技术)机试-试卷 12 答案解析(总分:2.00,做题时间:90 分钟)一、程序设计题(总题数:1,分数:2.00)1. (分数:2.00)_正确答案:(正确答案: )解析:解析:定义循环整型变量 i 和用于保存数组 xx 中的能被 3 整除或能被 7 整除的元素的个数变量cnt1,并把其值设置为 0。把全局变量 max、cnt 的初值设置为 0;把变量 pj 的初值设置为 0.0。 采用for 循环语句,循环变量 i 从

2、0 开始,依次递增到 N-1,对数组 xx 中的每一个数组元素 xxi用 if 条件语句判断其值是否能被 3 整除或能被 7 整除,如果 xxi满足上述条件,则把其值累加到变量 pj,同时变量 cnt1 的值加 1。 再判断数组元素 xxi与 max 的大小,如果 xxi大于 max,则 xxi的值赋给 max,同时把变量 cnt 的值赋为 1,如果 xxi等于 max,则变量 cnt 的值加 1。 退出循环后,用变量 pj 的值除以 cnt1 的值就得到满足条件的数的算术平均值。 在 for 循环语句对 200 个整数逐个进行扫描,判断其能被 3 整除或能被 7 整除的数,并把这些数累加到变量 pj,并统计这些数的个数,用这些数的和除以它们的个数,就得到 这些数的平均值。对于求出数组 xx 中的最大数 max 及最大数的个数 cnt 的问题,把数组 xx 中的第一个数赋给变量 max,对于能被 3 整除或能被 7 整除的数与 max 的值比较大小,如果此数比max 的值大,则把这个数赋值给 max,如果此数等于 max 的值,则最大数的个数 cnt 加 1。

展开阅读全文
相关资源
猜你喜欢
  • EN ISO 11074-2015 en Soil quality - Vocabulary《土壤质量 词汇 (ISO 11074 2015)》.pdf EN ISO 11074-2015 en Soil quality - Vocabulary《土壤质量 词汇 (ISO 11074 2015)》.pdf
  • EN ISO 11079-2007 en Ergonomics of the thermal environment - Determination and interpretation of cold stress when using required clothing insulation (IREQ) and local cooling effect.pdf EN ISO 11079-2007 en Ergonomics of the thermal environment - Determination and interpretation of cold stress when using required clothing insulation (IREQ) and local cooling effect.pdf
  • EN ISO 11085-2015 en Cereals cereals-based products and animal feeding stuffs - Determination of crude fat and total fat content by the Randall extraction method《谷物 谷物基产品和动物饲料 使用Ra.pdf EN ISO 11085-2015 en Cereals cereals-based products and animal feeding stuffs - Determination of crude fat and total fat content by the Randall extraction method《谷物 谷物基产品和动物饲料 使用Ra.pdf
  • EN ISO 11091-1999 en Construction Drawings - Landscape Drawing Practice《建筑制图 园林设计制图实用规程 ISO 11091-1994》.pdf EN ISO 11091-1999 en Construction Drawings - Landscape Drawing Practice《建筑制图 园林设计制图实用规程 ISO 11091-1994》.pdf
  • EN ISO 11092-2014 en Textiles - Physiological effects - Measurement of thermal and water-vapour resistance under steady-state conditions (sweating guarded-hotplate test)《纺织品 生理效应 稳.pdf EN ISO 11092-2014 en Textiles - Physiological effects - Measurement of thermal and water-vapour resistance under steady-state conditions (sweating guarded-hotplate test)《纺织品 生理效应 稳.pdf
  • EN ISO 11102-1-2009 en Reciprocating internal combustion engines - Handle starting equipment - Part 1 Safety requirements and tests《往复式内燃机 手柄起动装置 第1部分 安全要求和试验》.pdf EN ISO 11102-1-2009 en Reciprocating internal combustion engines - Handle starting equipment - Part 1 Safety requirements and tests《往复式内燃机 手柄起动装置 第1部分 安全要求和试验》.pdf
  • EN ISO 11102-2-2009 en Reciprocating internal combustion engines - Handle starting equipment - Part 2 Method of testing the angle of disengagement《往复式内燃机 手柄起动装置 第2部分 脱开角试验方法》.pdf EN ISO 11102-2-2009 en Reciprocating internal combustion engines - Handle starting equipment - Part 2 Method of testing the angle of disengagement《往复式内燃机 手柄起动装置 第2部分 脱开角试验方法》.pdf
  • EN ISO 11105-1997 en Small Craft - Ventilation of Petrol Engine and or Petrol Tank Compartments《小型船舶 装有强制点火发动机和 式油罐的房屋通风 ISO 11105-1997》.pdf EN ISO 11105-1997 en Small Craft - Ventilation of Petrol Engine and or Petrol Tank Compartments《小型船舶 装有强制点火发动机和 式油罐的房屋通风 ISO 11105-1997》.pdf
  • EN ISO 11105-2017 en Small craft - Ventilation of petrol engine and or petrol tank compartments.pdf EN ISO 11105-2017 en Small craft - Ventilation of petrol engine and or petrol tank compartments.pdf
  • 相关搜索

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

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