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

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

1、三级信息管理技术机试-199 及答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.已知数据文件 IN12.DAT 中存有 300 个四位数,并已调用读函数 readDat()把这些数存入数组 a 中,请编制一个函数 jsValue(),其功能是:求出个位数上的数减千位数上的数减百位数上的数减十位数上的数大于零的个数 cnt,再把所有满足此条件的四位数依次存入数组 b 中然后对数组 b 中的四位数按从大到小的顺序进行排序,最后调用写函数 writeDat()把数组 b 中的数输出到 OUT12.DAT 文件。例如:1239,9-1-2-30,则该

2、数满足条件,存入数组 b 中,且个数 cnt=cnt+1。8129,9-8-1-20,则该数不满足条件,忽略。注意:部分源程序已给出。程序中已定义数组:a300,b300;已定义变量:cnt。请勿改动主函数main()、读函数 readDat()和写函数 writeDat()的内容。试题程序#includestdio.hInt a300,b300,cnt=0;void jsValue()main()int i;readDat();jsValue();writeDat();for(i=0;icnt;i+)printf(“b%d=%dn“,i,bi);readDat()FILE *fp;int i

3、fp=fopen(“IN12.DAT“,“r“);fori=0;i300;i+)fscanf(fp,“%d,“,icnt;i+)printf(“b%d=%dn“,i,bi);readDat()FILE *fp;int i:fp=fopen(“IN12.DAT“,“r“);fori=0;i300;i+)fscanf(fp,“%d,“,for(i=0;i300;i+)thou=ai/1000; /*取得四位数的千位数字*/hun=ai%1000/100; /*取得四位数的百位数字*/ten=ai%100/10; /*取得四位数的十位数字*/data=ai%10; /*取得四位数的个位数字*/if(data-thou-hun-ten0)bcnt=9i;cnt+;)for(i=0;icnt-1;i+) /*将数组 b 中的四位数按从大到小的顺序进行排序*/for(j=i+1;jcnt;j+)if(bibj)data=bi;bi=bj;bj=data;)解析:解析 此题型考查的知识点包括以下几方面:(1) 运算符“/”(相除)和“%”(取余)的灵活运用;(2) 循环结构的使用;(3) 数据的排序(在这里主要是使用选择排序法);(4) 选择结构的使用。此函数的功能是:将满足“个位数-千位数-百位数-十位数0”的四位数依次存入数组 b 中,然后对数组b 中的四位数按从大到小的顺序进行排序。

展开阅读全文
相关资源
猜你喜欢
  • GOST EN 581-1-2012 Outdoor furniture Seating and tables for camping domestic and contract use Part 1 General safety requirements《户外家具 野营 家用和商用桌椅 第1部分 通用安全要求》.pdf GOST EN 581-1-2012 Outdoor furniture Seating and tables for camping domestic and contract use Part 1 General safety requirements《户外家具 野营 家用和商用桌椅 第1部分 通用安全要求》.pdf
  • GOST EN 581-2-2012 Outdoor furniture Seating and tables for camping domestic and contract use Part 2 Mechanical safety requirements and test methods for seating《户外家具 野营 家用和商用桌椅 第2部.pdf GOST EN 581-2-2012 Outdoor furniture Seating and tables for camping domestic and contract use Part 2 Mechanical safety requirements and test methods for seating《户外家具 野营 家用和商用桌椅 第2部.pdf
  • GOST EN 581-3-2012 Outdoor furniture Seating and tables for camping domestic and contract use Part 3 Mechanical safety requirements and test methods for tables《户外家具 野营 家用和商用桌椅 第3部分.pdf GOST EN 581-3-2012 Outdoor furniture Seating and tables for camping domestic and contract use Part 3 Mechanical safety requirements and test methods for tables《户外家具 野营 家用和商用桌椅 第3部分.pdf
  • GOST EN 609-1-2012 Agricultural and forestry machinery Safety of log splitters Part 1 Wedge splitters《农林业用机械 原木劈木机安全 第1部分 楔形劈木机》.pdf GOST EN 609-1-2012 Agricultural and forestry machinery Safety of log splitters Part 1 Wedge splitters《农林业用机械 原木劈木机安全 第1部分 楔形劈木机》.pdf
  • GOST EN 609-2-2012 Agricultural and forestry machiner Safety of log splitters Part 2 Screw splitters《农林业用机械 原木劈木机安全 第2部分 螺旋劈木机》.pdf GOST EN 609-2-2012 Agricultural and forestry machiner Safety of log splitters Part 2 Screw splitters《农林业用机械 原木劈木机安全 第2部分 螺旋劈木机》.pdf
  • GOST EN 614-2-2012 Safety of machinery Ergonomic design principles Part 2 Interactions between the design of machinery and work tasks《机械安全 人类工效学设计原则 第2部分 机械设计和工作任务之间的交互作用》.pdf GOST EN 614-2-2012 Safety of machinery Ergonomic design principles Part 2 Interactions between the design of machinery and work tasks《机械安全 人类工效学设计原则 第2部分 机械设计和工作任务之间的交互作用》.pdf
  • GOST EN 620-2012 Continuous handling equipment and systems Fixed belt conveyers for bulk materials Safety and EMC requirements《连续搬运设备和系统 散料用固定式皮带输送装置 安全和EMC要求》.pdf GOST EN 620-2012 Continuous handling equipment and systems Fixed belt conveyers for bulk materials Safety and EMC requirements《连续搬运设备和系统 散料用固定式皮带输送装置 安全和EMC要求》.pdf
  • GOST EN 1005-2-2005 Safety of machinery Human physical performance Part 2 Manual handling of machinery and component parts of machinery《机械安全性 人员体能 第2部分 人工装卸机械和机械零部件》.pdf GOST EN 1005-2-2005 Safety of machinery Human physical performance Part 2 Manual handling of machinery and component parts of machinery《机械安全性 人员体能 第2部分 人工装卸机械和机械零部件》.pdf
  • GOST EN 1005-4-2013 Safety of machinery Human physical performance Part 4 Evaluation of working postures and movements in relation to machinery《机械安全 人体物理性能 第4部分 与机械相关的工作姿势和活动的评价》.pdf GOST EN 1005-4-2013 Safety of machinery Human physical performance Part 4 Evaluation of working postures and movements in relation to machinery《机械安全 人体物理性能 第4部分 与机械相关的工作姿势和活动的评价》.pdf
  • 相关搜索

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

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