【计算机类职业资格】三级信息管理技术机试-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 中的四位数按从大到小的顺序进行排序。

展开阅读全文
相关资源
猜你喜欢
  • ASTM D1751-2018 Standard Specification for Preformed Expansion Joint Filler for Concrete Paving and Structural Construction (Nonextruding and Resilient Bituminous Types).pdf ASTM D1751-2018 Standard Specification for Preformed Expansion Joint Filler for Concrete Paving and Structural Construction (Nonextruding and Resilient Bituminous Types).pdf
  • ASTM D1752-2004a Standard Specification for Preformed Sponge Rubber Cork and Recycled PVC Expansion Joint Fillers for Concrete Paving and Structural Construction《混凝土铺面和结构建筑用预制微孔橡胶与.pdf ASTM D1752-2004a Standard Specification for Preformed Sponge Rubber Cork and Recycled PVC Expansion Joint Fillers for Concrete Paving and Structural Construction《混凝土铺面和结构建筑用预制微孔橡胶与.pdf
  • ASTM D1752-2004a(2008) Standard Specification for Preformed Sponge Rubber Cork and Recycled PVC Expansion Joint Fillers for Concrete Paving and Structural Construction《混凝土铺面和结构建筑用预.pdf ASTM D1752-2004a(2008) Standard Specification for Preformed Sponge Rubber Cork and Recycled PVC Expansion Joint Fillers for Concrete Paving and Structural Construction《混凝土铺面和结构建筑用预.pdf
  • ASTM D1752-2004a(2013) Standard Specification for Preformed Sponge Rubber Cork and Recycled PVC Expansion Joint Fillers for Concrete Paving and Structural Construction《混凝土铺面和结构建筑用预.pdf ASTM D1752-2004a(2013) Standard Specification for Preformed Sponge Rubber Cork and Recycled PVC Expansion Joint Fillers for Concrete Paving and Structural Construction《混凝土铺面和结构建筑用预.pdf
  • ASTM D1754 D1754M-2009 Standard Test Method for Effect of Heat and Air on Asphaltic Materials (Thin-Film Oven Test)《热量和空气对沥青材料(薄膜蒸发器烘箱试验)影响效果的标准试验方法》.pdf ASTM D1754 D1754M-2009 Standard Test Method for Effect of Heat and Air on Asphaltic Materials (Thin-Film Oven Test)《热量和空气对沥青材料(薄膜蒸发器烘箱试验)影响效果的标准试验方法》.pdf
  • ASTM D1754 D1754M-2009(2014) Standard Test Method for Effects of Heat and Air on Asphaltic Materials &40 Thin-Film Oven Test&41 《加热和空气对沥青材料影响的标准试验方法 (薄膜炉试验)》.pdf ASTM D1754 D1754M-2009(2014) Standard Test Method for Effects of Heat and Air on Asphaltic Materials &40 Thin-Film Oven Test&41 《加热和空气对沥青材料影响的标准试验方法 (薄膜炉试验)》.pdf
  • ASTM D1754-1997(2002) Standard Test Method for Effect of Heat and Air on Asphaltic Materials (Thin-Film Oven Test)《加热和空气对沥青材料影响的试验方法(薄膜炉试验)》.pdf ASTM D1754-1997(2002) Standard Test Method for Effect of Heat and Air on Asphaltic Materials (Thin-Film Oven Test)《加热和空气对沥青材料影响的试验方法(薄膜炉试验)》.pdf
  • ASTM D1755-1992(2001) Standard Specification for Poly(Vinyl Chloride) Resins《聚氯乙烯树脂标准规范》.pdf ASTM D1755-1992(2001) Standard Specification for Poly(Vinyl Chloride) Resins《聚氯乙烯树脂标准规范》.pdf
  • ASTM D1755-2009 Standard Specification for Poly(Vinyl Chloride) Resins《聚氯乙烯树脂标准规范》.pdf ASTM D1755-2009 Standard Specification for Poly(Vinyl Chloride) Resins《聚氯乙烯树脂标准规范》.pdf
  • 相关搜索

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

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