【计算机类职业资格】三级数据库技术机试-217及答案解析.doc

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

1、三级数据库技术机试-217 及答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.函数 ReadDat()实现从文件 IN.dat中读取 1000个十进制整数到数组 xx中;请编写函数 Compute()分别计算出数组 xx中奇数的个数 odd、偶数的个数 even,以及所有数的平均值 aver和方差 totfc的值。最后调用函数 WriteDat(),把结果输出到 OUT. dat文件中。计算方差的公式如下:(分数:100.00)_三级数据库技术机试-217 答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:10

2、0.00)1.函数 ReadDat()实现从文件 IN.dat中读取 1000个十进制整数到数组 xx中;请编写函数 Compute()分别计算出数组 xx中奇数的个数 odd、偶数的个数 even,以及所有数的平均值 aver和方差 totfc的值。最后调用函数 WriteDat(),把结果输出到 OUT. dat文件中。计算方差的公式如下:(分数:100.00)_正确答案:(void Compute (void) int i;for (i=0; i1000; i+) if (xx i %2)odd+;elseeven+;aver = aver+ xxi;aver /= MAX;for (i=0; i1000; i+)totfc += (xxi-aver)*(xxi-aver)/MAX;)解析:解题思路 对数组 xxi中的 1000个整数逐个进行扫描处理,如果 xxi对 2的余数为 1,则xxi为奇数,变量 odd加 1;否则 xxi为偶数,变量 even加 1。把 xxi的值与变量 aver相加存入变量 aver中。退出循环时,变量 aver的值除以 MAX就得到平均值。最后在 for循环语句中根据方差的公式求出所有数的方差。

展开阅读全文
相关资源
猜你喜欢
  • EN 12468-1997 en Biotechnology - Modified Organisms for Application in the Environment - Guidance for the Monitoring Strategies for Deliberate Releases of Genetically Modified Plan.pdf EN 12468-1997 en Biotechnology - Modified Organisms for Application in the Environment - Guidance for the Monitoring Strategies for Deliberate Releases of Genetically Modified Plan.pdf
  • EN 12469-2000 en Biotechnology - Performance Criteria for Microbiological Safety Cabinets《生物技术 微生物安全柜的性能》.pdf EN 12469-2000 en Biotechnology - Performance Criteria for Microbiological Safety Cabinets《生物技术 微生物安全柜的性能》.pdf
  • EN 1247-2004 en Foundry machinery - Safety requirements for ladles pouring equipment centrifugal casting machines continuous and semi continuous casting machines (Incorporates Amen.pdf EN 1247-2004 en Foundry machinery - Safety requirements for ladles pouring equipment centrifugal casting machines continuous and semi continuous casting machines (Incorporates Amen.pdf
  • EN 12470-1-2000 en Clinical thermometers - Part 1 Metallic liquid-in-glass thermometers with maximum device (Incorporates Amendment A1 2009)《临床温度计 第1部分 配备最大器件的金属玻璃中液体体温计 包含修改件A1-20.pdf EN 12470-1-2000 en Clinical thermometers - Part 1 Metallic liquid-in-glass thermometers with maximum device (Incorporates Amendment A1 2009)《临床温度计 第1部分 配备最大器件的金属玻璃中液体体温计 包含修改件A1-20.pdf
  • EN 12470-2-2000 en Clinical thermometers - Part 2 Phase change type (dot matrix) thermometers (Incorporates Amendment A1 2009)《临床温度计 第2部分 相变型(点阵)温度计 包含修改件A1-2009》.pdf EN 12470-2-2000 en Clinical thermometers - Part 2 Phase change type (dot matrix) thermometers (Incorporates Amendment A1 2009)《临床温度计 第2部分 相变型(点阵)温度计 包含修改件A1-2009》.pdf
  • EN 12472-2005 en Method for the simulation of wear and corrosion for the detection of nickel release from coated items (Incorporates Amendment A1 2009)《测量电镀涂层物件在催化及磨损后镍释放量测试 包含修改件A.pdf EN 12472-2005 en Method for the simulation of wear and corrosion for the detection of nickel release from coated items (Incorporates Amendment A1 2009)《测量电镀涂层物件在催化及磨损后镍释放量测试 包含修改件A.pdf
  • EN 12473-2014 en General principles of cathodic protection in seawater《海水中阴极保护的一般原理》.pdf EN 12473-2014 en General principles of cathodic protection in seawater《海水中阴极保护的一般原理》.pdf
  • EN 12474-2001 en Cathodic Protection of Submarine Pipelines《海底管道的阴极保护》.pdf EN 12474-2001 en Cathodic Protection of Submarine Pipelines《海底管道的阴极保护》.pdf
  • EN 12477-2001 en Protective Gloves for Welders (Incorporates Amendment A1 2005)《焊工防护手套 包含修改件A1-2005》.pdf EN 12477-2001 en Protective Gloves for Welders (Incorporates Amendment A1 2005)《焊工防护手套 包含修改件A1-2005》.pdf
  • 相关搜索

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

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