[计算机类试卷]国家三级信息管理技术机试模拟试卷126及答案与解析.doc

上传人:orderah291 文档编号:494928 上传时间:2018-11-28 格式:DOC 页数:3 大小:27.50KB
下载 相关 举报
[计算机类试卷]国家三级信息管理技术机试模拟试卷126及答案与解析.doc_第1页
第1页 / 共3页
[计算机类试卷]国家三级信息管理技术机试模拟试卷126及答案与解析.doc_第2页
第2页 / 共3页
[计算机类试卷]国家三级信息管理技术机试模拟试卷126及答案与解析.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

1、国家三级信息管理技术机试模拟试卷 126及答案与解析 一、程序设计题 1 下列程序的功能是:将一正整数序列 K1, K2, , K9重新排成一个新的序列。新序列中,比 K1小的数都在 K1的左面 (后续的再向左存放 ),比 K1大的数都在 K1的右面 (后续的再向右存放 ),从 K1向右扫描。要求编写函数 jsValue()实现此功能,最后调用函数 writeDat()把新序列输出到文件 out90.dat中。 说明,在程序中已给出了 10个序列,每个序列中有 9个正整数,并存入数组a109中,分别求出这 10个新序列。 例如,序列排序前 6, 8, 9, 1, 2, 5, 4, 7, 3 序

2、列排序后 3, 4, 5, 2, 1, 6, 8, 9, 7 注意:部分源程序已给出。 请勿改动主函数 main()和写函数 writeDat()的内容。 试题程序: #include stdio.h jsValue(int a109) main() int a10 9=6,8,9,1,2,5,4,7,3, 3,5,8 9,1,2,6,4,7, 8,2,1 9,3,5,4,6,7, 3,5,1 2,9,8,6,7,4, 4,7,8 9,1,2 5,3,6, 4,7,3 5,1,2 6,8,9, 9,1,3 5,8,6 2,4,7, 2,6,1 9,8,3 5,7,4, 5,3,7,9,1,8

3、2,6,4, 7,1,3,2,5,8 9,4,6, ; int i,j; jsValue (a); for(i=0 ;i 10; i+) for(j=0;j 9; j+) printf(“%d“,ai j); if(j =7) printf(“,“); printf (“n“); writeDat (a); writeDat(int a109) FILE *fp; int i,j; fp=fopen(“out90.dat“,“w“); for(i=0;i 10;i+) for(j=0;j 9;j+) fprintf(fp,“%d“,aij); if(j =7) fprintf(fp,“,“);

4、 fprintf(fp,“n“); fclose(fp); 国家三级信息管理技术机试模拟试卷 126答案与解析 一、程序设计题 1 【正确答案】 void jsValue(int a109) int value,i,j,k,num; for(i=0;i 10;i+) value=ai0; /*将一行的第一个元素赋给 value*/ for(j=0;j 9;j+) if(aij value) /*若后面的数中有比第 1个数据小的数 */ num=aij; /*则把这个数取出,赋给 num*/ for(k=j;k 0;k-) /*将这个数据左侧的数依次向右移动 */ aik=aik-1; ai0=num; /*再将这个数放在最左侧 */ 【试题解析】 本题考查的知识点如下: (1)二维数组的访问和数组元素的移动。 (2)循环结构和判断结构的嵌套使用。 数据存放在一个二维数组中,每一行数为数据处理的基本单位。将第 1个数取出依次和后面的数比较,若后面的数中有比第 1个数据小的数,则将这个数取出。将这个数据左侧的数依次向右移动 (包括第 1个数 ),然后将这个数放在最左侧。扫描完一行后,比第 1个数小的数就都在第 1个数的左侧 ,而比它大的就在它的右侧。对数的扫描和移动均可以使用循环实现。再使用循环实现对每一行数据的访问。

展开阅读全文
相关资源
猜你喜欢
  • BS PD CEN TR 15149-3-2014 Solid biofuels Determination of particle size distribution Rotary screen method《固体生物燃料 粒度分布的测定 回转筛选法》.pdf BS PD CEN TR 15149-3-2014 Solid biofuels Determination of particle size distribution Rotary screen method《固体生物燃料 粒度分布的测定 回转筛选法》.pdf
  • BS PD CEN TR 15160-2005 Petroleum and related products - Applicability of diesel fuel test methods for Fatty Acid Methyl Esters (FAME) - Information and results non round .pdf BS PD CEN TR 15160-2005 Petroleum and related products - Applicability of diesel fuel test methods for Fatty Acid Methyl Esters (FAME) - Information and results non round .pdf
  • BS PD CEN TR 15177-2006 Testing the freeze-thaw resistance of concrete — Internal structural damage《混凝土抗冻融性能试验 内部结构损坏》.pdf BS PD CEN TR 15177-2006 Testing the freeze-thaw resistance of concrete — Internal structural damage《混凝土抗冻融性能试验 内部结构损坏》.pdf
  • BS PD CEN TR 15193-2-2017 Energy performance of buildings Energy requirements for lighting Explanation and justification of EN 15193-1 Module M9《建筑物能源性能 照明的能源需求 EN 15193-1.pdf BS PD CEN TR 15193-2-2017 Energy performance of buildings Energy requirements for lighting Explanation and justification of EN 15193-1 Module M9《建筑物能源性能 照明的能源需求 EN 15193-1.pdf
  • BS PD CEN TR 15232-2-2016 Energy performance of buildings Accompanying TR prEN 15232-1 2015 Modules M10-4 5 6 7 8 9 10《建筑的能源性能 引用TR prEN 15232-1-2015 M10-4 5 6 7 8 9 10模块》.pdf BS PD CEN TR 15232-2-2016 Energy performance of buildings Accompanying TR prEN 15232-1 2015 Modules M10-4 5 6 7 8 9 10《建筑的能源性能 引用TR prEN 15232-1-2015 M10-4 5 6 7 8 9 10模块》.pdf
  • BS PD CEN TR 15276-1-2009 Fixed firefighting nsystems — Condensed naerosol extinguishing nsystems nPart 1 Requirements and test methods nfor components《固定的消防系统 浓缩气溶胶灭火系统 .pdf BS PD CEN TR 15276-1-2009 Fixed firefighting nsystems — Condensed naerosol extinguishing nsystems nPart 1 Requirements and test methods nfor components《固定的消防系统 浓缩气溶胶灭火系统 .pdf
  • BS PD CEN TR 15276-2-2009 Fixed firefighting nsystems — Condensed naerosol extinguishing nsystems nPart 2 Design installation and nmaintenance《固定式消防系统 浓缩气溶胶灭火系统 第2部分 设计、安.pdf BS PD CEN TR 15276-2-2009 Fixed firefighting nsystems — Condensed naerosol extinguishing nsystems nPart 2 Design installation and nmaintenance《固定式消防系统 浓缩气溶胶灭火系统 第2部分 设计、安.pdf
  • BS PD CEN TR 15278-2006 Workplace exposure - Strategy for the evaluation of dermal exposure《作业场所暴露 经皮暴露的评估策略》.pdf BS PD CEN TR 15278-2006 Workplace exposure - Strategy for the evaluation of dermal exposure《作业场所暴露 经皮暴露的评估策略》.pdf
  • BS PD CEN TR 15281-2006 Guidance on Inerting for the Prevention of Explosions《爆炸预防用惰化导则》.pdf BS PD CEN TR 15281-2006 Guidance on Inerting for the Prevention of Explosions《爆炸预防用惰化导则》.pdf
  • 相关搜索

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

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