【计算机类职业资格】三级信息管理技术机试-215及答案解析.doc

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

1、三级信息管理技术机试-215 及答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.已知数据文件 in.dat 中存有 200 个 4 位数,并已调用读函数 ReadDat()把这些数存入数组 a 中,请考生编制一函数 jsval(),其功能是:如果 4 位数各位上的数均是奇数,则统计出满足此条件的个数 cnt 并把这些 4 位数按从大到小的顺序存入数组 b 中。最后 main()函数训用写函数 writeDat()把结果 cnt 及数组 b 中符合条件的 4 位数输出到 out.dat 文件中。注意:部分源程序已经给出。程序中已定义数组 a20

2、0,b200,已定义变量:cnt。请勿改动数据文件 in.dat 中的任何数据、主函数 main()、读函数 readDat()和写函数 writeDat()的内容。试题源程序#includestdioh#define MAX 200int aMAX,KMAX,cnt=0;void writeDat();void JsVal()void teadDat()int i;FILE*fp;fp=fopen(“indat“,“r“):for(i=0;iMAX;i+)fscanf(fp,“%cr,bi=bEj;bj=k;)解析:解析 本题主要考查的是数位分解问题。本题主要考查的知识点包括:C 语言循环结构,if 判断语句和逻辑表达式,以及分解多位整数的算术运算。首先用 for 循环和变量 i 遍历数组的每个元素,对于某一元素 ai,用%和/运算将各个位数分解出来,存放到数组 ss 中,使用 for 循环和变量 j 判断数组 ss中各个数是否都是奇数,如果是则标志 flag 置为 1,有一个是偶数则置为 0 并且跳出循环,如果 flag 为1,则说明满足都是奇数的条件,将该数 at存入数组 b 中,统计变量 cnt 增 1,当所有元素遍历完后给数组 b 中的元素使用冒泡排序法进行排序。

展开阅读全文
相关资源
猜你喜欢
  • EN ISO 17075-2-2017 en Leather - Chemical determination of chromium(VI) content in leather - Part 2 Chromatographic method《皮革铬(VI)的化学测定皮革中的第2部分内容 色谱法(ISO 17075-2 2017)》.pdf EN ISO 17075-2-2017 en Leather - Chemical determination of chromium(VI) content in leather - Part 2 Chromatographic method《皮革铬(VI)的化学测定皮革中的第2部分内容 色谱法(ISO 17075-2 2017)》.pdf
  • EN ISO 17075-2007 Leather - Chemical tests - Determination of chromium(VI) content《皮革 化学试验 氯(VI)含量的测定[被代替 CEN CEN TS 14495]》.pdf EN ISO 17075-2007 Leather - Chemical tests - Determination of chromium(VI) content《皮革 化学试验 氯(VI)含量的测定[被代替 CEN CEN TS 14495]》.pdf
  • EN ISO 17076-1-2012 en Leather - Determination of abrasion resistance - Part 1 Taber method《皮革 耐磨性的测定 泰伯尔法》.pdf EN ISO 17076-1-2012 en Leather - Determination of abrasion resistance - Part 1 Taber method《皮革 耐磨性的测定 泰伯尔法》.pdf
  • EN ISO 17076-2-2011 en Leather - Determination of abrasion resistance - Part 2 Martindale ball plate method《皮革 耐磨性测定 第2部分 马尔代丁球板法》.pdf EN ISO 17076-2-2011 en Leather - Determination of abrasion resistance - Part 2 Martindale ball plate method《皮革 耐磨性测定 第2部分 马尔代丁球板法》.pdf
  • EN ISO 17078-1-2004 en Petroleum and natural gas industries - Drilling and production equipment - Part 1 Side-pocket mandrels (Incorporates Amendment A1 2010)《石油和天然气工业 钻井和生产设备 第1部分.pdf EN ISO 17078-1-2004 en Petroleum and natural gas industries - Drilling and production equipment - Part 1 Side-pocket mandrels (Incorporates Amendment A1 2010)《石油和天然气工业 钻井和生产设备 第1部分.pdf
  • EN ISO 17078-2-2007 en Petroleum and natural gas industries - Drilling and production equipment - Part 2 Flow-control devices for side-pocket mandrels《石油和天然气工业 钻井和生产设备 第2部分 偏心轴的流控制.pdf EN ISO 17078-2-2007 en Petroleum and natural gas industries - Drilling and production equipment - Part 2 Flow-control devices for side-pocket mandrels《石油和天然气工业 钻井和生产设备 第2部分 偏心轴的流控制.pdf
  • EN ISO 17078-3-2009 en Petroleum and natural gas industries - Drilling and production equipment - Part 3 Running tools pulling tools and kick-over tools and latches for side-pocket.pdf EN ISO 17078-3-2009 en Petroleum and natural gas industries - Drilling and production equipment - Part 3 Running tools pulling tools and kick-over tools and latches for side-pocket.pdf
  • EN ISO 17081-2014 en Method of measurement of hydrogen permeation and determination of hydrogen uptake and transport in metals by an electrochemical technique《氢渗透的测量方法和用电化学法技术测定金属中.pdf EN ISO 17081-2014 en Method of measurement of hydrogen permeation and determination of hydrogen uptake and transport in metals by an electrochemical technique《氢渗透的测量方法和用电化学法技术测定金属中.pdf
  • EN ISO 17100-2015 en Translation services - Requirements for translation services (Incorporates Amendment A1 2015)《翻译服务 翻译服务要求(ISO 17100 2015)》.pdf EN ISO 17100-2015 en Translation services - Requirements for translation services (Incorporates Amendment A1 2015)《翻译服务 翻译服务要求(ISO 17100 2015)》.pdf
  • 相关搜索

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

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