[计算机类试卷]国家三级(网络技术)机试模拟试卷260及答案与解析.doc

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

1、国家三级(网络技术)机试模拟试卷 260及答案与解析 一、程序设计题 1 文件 IN DAT中存有 200个四位整型数,函数 readData()负责将 IN DAT中的数据读到数组 inBuf中。请编制一函数 findData(),该函数的功能是;依次从数组inBuf中取出一个四位数,如果四位数连续大于该四位数前的 5个数且该数是奇数(该四位数以前不满 5个数,则不统计 ),该数必须能被 7整除,则按照从小到大的顺序存人 outBuf中,并用 count记录下符合条件的数据的个数。函数 writeData()负责将 outBuf中的数据输出到文件 OUT DAT中,并且在屏幕上输出。 注意;

2、部分源程序已给出。 程序中已定义数组; inBuf200, outBuf200,已定义变量; count。 请勿改动主函数 main()、读函数 readData()和写函数 writeData()的内容。 试题程序; #include #define MAX 200 int inBufMAX, outBufMAX, count=0; void findData() void readData() int i; FILE*fp; fp=fopen(“IN DAT“, “r“); for(i=0; ioutBufj) 如果第 i位比它 后面的数大 则将两者进行交换,也即将更小的数放到第 i位 temp; outBufi; outBufi=outBufj; outBufj=temp; 【试题解析】 本题考查的主要是数据的奇偶性判断及数据的排序。基本思想是;1查找符合要求的,利用条件 inBufi 2!=0找出奇数。用该数与其前面的连续5个数相比较,如果有一个数不符合要求 (小于或等于后面的数 ),则可将该数排除,这样便可找出所有符合要求的项。 2将当前数与其后 的各个数相比较,如果当前数比其后的数大,则将两数据进行交换,从而使得前面的数小于后面的数,最终达到从小到大排序的目的。

展开阅读全文
相关资源
猜你喜欢
  • BS QC 400203-1993 Specification for fixed resistors for use in electronic equipment Blank detail specification Fixed power resistors heat-sink types Assessment level H《电子设备用固定电阻器规范 空白详细规范 固定功率.pdf BS QC 400203-1993 Specification for fixed resistors for use in electronic equipment Blank detail specification Fixed power resistors heat-sink types Assessment level H《电子设备用固定电阻器规范 空白详细规范 固定功率.pdf
  • BS QC 760000-1990 Harmonized system of quality assessment for electronic components Film and hybrid film integrated circuits Generic specification《电子元器件质量评估协调体系 薄膜和混合薄膜集成电路 一般规范》.pdf BS QC 760000-1990 Harmonized system of quality assessment for electronic components Film and hybrid film integrated circuits Generic specification《电子元器件质量评估协调体系 薄膜和混合薄膜集成电路 一般规范》.pdf
  • BS S 148-1969 Specification for low nickel-chromium steel (bar for the manufacture of forged bolts only)《仅用于锻制螺栓的低镍-铬钢棒规范》.pdf BS S 148-1969 Specification for low nickel-chromium steel (bar for the manufacture of forged bolts only)《仅用于锻制螺栓的低镍-铬钢棒规范》.pdf
  • BS S 153-1976 Specification 21 2% nickel-chromium-molybdenum steel billets bars forgings and parts (1230-1430 MPa limiting ruling section 40 mm)《规范 5 2%镍-铬-钼钢方坯、棒材、锻件及零件(1230-1430MPa 限定等圆断面40mm)》.pdf BS S 153-1976 Specification 21 2% nickel-chromium-molybdenum steel billets bars forgings and parts (1230-1430 MPa limiting ruling section 40 mm)《规范 5 2%镍-铬-钼钢方坯、棒材、锻件及零件(1230-1430MPa 限定等圆断面40mm)》.pdf
  • BS S 154-1976 Specification 21 2% nickel-chromium-molybdenum steel billets bars forgings and parts (880-1080 MPa limiting ruling section 150 mm)《规范 5 2%镍-铬-钼钢方坯、棒材、锻件及零件规范(880-1080MPa 限定等圆断面150m.pdf BS S 154-1976 Specification 21 2% nickel-chromium-molybdenum steel billets bars forgings and parts (880-1080 MPa limiting ruling section 150 mm)《规范 5 2%镍-铬-钼钢方坯、棒材、锻件及零件规范(880-1080MPa 限定等圆断面150m.pdf
  • BS S 156-1976 Specification for 4% nickel-chromium-molybdenum case-hardening steel (vacuum arc remelted) billets bars forgings and parts (1320-1520 MPa)《4%镍-铬-钼表面硬化钢(真空电弧重熔)坯、棒材、锻件及零件规范(1320-1520M.pdf BS S 156-1976 Specification for 4% nickel-chromium-molybdenum case-hardening steel (vacuum arc remelted) billets bars forgings and parts (1320-1520 MPa)《4%镍-铬-钼表面硬化钢(真空电弧重熔)坯、棒材、锻件及零件规范(1320-1520M.pdf
  • BS S 157-1976 Specification 3% nickel-chromium-molybdenum case-hardening steel billets bars forgings and parts (1180-1380 MPa)《规范 3%镍-铬-钼表面硬化钢方坯、棒材、锻件及零件(1180-1380MPa)》.pdf BS S 157-1976 Specification 3% nickel-chromium-molybdenum case-hardening steel billets bars forgings and parts (1180-1380 MPa)《规范 3%镍-铬-钼表面硬化钢方坯、棒材、锻件及零件(1180-1380MPa)》.pdf
  • BS S 158-1977 Specification for 1% chromium-molybdenum steel bars for the manufacture of forged bolts and forged nuts《锻制螺栓和螺母的含1%铬-钼钢棒规范》.pdf BS S 158-1977 Specification for 1% chromium-molybdenum steel bars for the manufacture of forged bolts and forged nuts《锻制螺栓和螺母的含1%铬-钼钢棒规范》.pdf
  • BS S 162-1990 Specification for 18% nickel-cobalt-molybdenum maraging steel forging stock forgings bars and parts (1800 MPa double vaccuum melted)《锻坯、锻件、棒材和零件用18%镍-钴-钼马氏体时效钢(1800MPa 双倍真空熔化)规范》.pdf BS S 162-1990 Specification for 18% nickel-cobalt-molybdenum maraging steel forging stock forgings bars and parts (1800 MPa double vaccuum melted)《锻坯、锻件、棒材和零件用18%镍-钴-钼马氏体时效钢(1800MPa 双倍真空熔化)规范》.pdf
  • 相关搜索

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

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