【计算机类职业资格】国家二级(C语言)机试-试卷25-2及答案解析.doc

上传人:deputyduring120 文档编号:1334660 上传时间:2019-10-17 格式:DOC 页数:2 大小:38.50KB
下载 相关 举报
【计算机类职业资格】国家二级(C语言)机试-试卷25-2及答案解析.doc_第1页
第1页 / 共2页
【计算机类职业资格】国家二级(C语言)机试-试卷25-2及答案解析.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、国家二级(C 语言)机试-试卷 25-2 及答案解析(总分:12.00,做题时间:90 分钟)一、程序填空题(总题数:2,分数:4.00)1.程序填空题()(分数:2.00)_2.函数 fun 的功能是:从三个形参 a,b,c 中找出中间的那个数,作为函数值返回。例如,当a3,b5,c4 时,中数为 4。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文件夹下的 BLANKlC 中。不得增行或删行,也不得更改程序的结构!(分数:2.00)_二、程序修改题(总题数:2,分数:4.00)3.程序修改题()(分数:2.00)_4.给定程序 MODllC 中

2、函数 fun 的功能是:根据形参 m 的值(2m9),在 m 行 m 列的二维数组中存放如下所示规律的数据,由 main 函数输出。例如,若输入 2 若输入 4 则输出: 则输出: 1 2 1 2 3 4 2 4 2 4 6 8 3 6 9 12 4 8 12 16 请改正程序函数中的错误,使它能得出正确的结果。 注意:不要改动 main 函数,不得增行或删行,也不得更改程序的结构! (分数:2.00)_三、程序设计题(总题数:2,分数:4.00)5.程序设计题()(分数:2.00)_6.学生的记录由学号和成绩组成,N 名学生的数据已在主函数中放入结构体数组 s 中,请编写函数 fun,它的功

3、能是:把分数最低的学生数据放在 b 所指的数组中,注意:分数最低的学生可能不止一个,函数返回分数最低的学生的人数。 注意:部分源程序在文件 PROGlC 文件中。 请勿改动主函数 main 和其他函数中的任何内容,仅在函数 fun 的花括号中填入你编写的若干语句。 (分数:2.00)_国家二级(C 语言)机试-试卷 25-2 答案解析(总分:12.00,做题时间:90 分钟)一、程序填空题(总题数:2,分数:4.00)1.程序填空题()(分数:2.00)_解析:2.函数 fun 的功能是:从三个形参 a,b,c 中找出中间的那个数,作为函数值返回。例如,当a3,b5,c4 时,中数为 4。请在

4、程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文件夹下的 BLANKlC 中。不得增行或删行,也不得更改程序的结构!(分数:2.00)_正确答案:(正确答案:(1)a (2)a (3)b)解析:解析:本题中 fun 函数的功能是求得三个数中间的数,从 fun 函数给出的部分来看,fun 函数是采用条件运算符来求中间值。二、程序修改题(总题数:2,分数:4.00)3.程序修改题()(分数:2.00)_解析:4.给定程序 MODllC 中函数 fun 的功能是:根据形参 m 的值(2m9),在 m 行 m 列的二维数组中存放如下所示规律的数据,由 main

5、 函数输出。例如,若输入 2 若输入 4 则输出: 则输出: 1 2 1 2 3 4 2 4 2 4 6 8 3 6 9 12 4 8 12 16 请改正程序函数中的错误,使它能得出正确的结果。 注意:不要改动 main 函数,不得增行或删行,也不得更改程序的结构! (分数:2.00)_正确答案:(正确答案:(1)void fun(int aM, int m)(2)ajk=(k+1)*(j+1);)解析:解析:本题中函数的功能是根据形参 m 的值(2m9),在 m 行 m 列的二维数组中存放有规律的数据,规律就是,i 和 j 代表二维数组的行和列,则 a 啪k(k1)*(j1)。三、程序设计题

6、总题数:2,分数:4.00)5.程序设计题()(分数:2.00)_解析:6.学生的记录由学号和成绩组成,N 名学生的数据已在主函数中放入结构体数组 s 中,请编写函数 fun,它的功能是:把分数最低的学生数据放在 b 所指的数组中,注意:分数最低的学生可能不止一个,函数返回分数最低的学生的人数。 注意:部分源程序在文件 PROGlC 文件中。 请勿改动主函数 main 和其他函数中的任何内容,仅在函数 fun 的花括号中填入你编写的若干语句。 (分数:2.00)_正确答案:(正确答案: )解析:解析:该程序功能是把分数最低的学生数据放在 b 所指的数组中。本题是关于求解结构体中某些成员的最小值,首先将第一个值设定为最小值,并在循环中将其他所有值与该值进行比较,求得最小值。然后将最小值与所有值进行比较,求得所有的最小值。

展开阅读全文
相关资源
猜你喜欢
  • GOST R 53091-2008 Soil quality Sampling Part 3 Guidance on safety《土壤质量 取样 第3部分 安全指南》.pdf GOST R 53091-2008 Soil quality Sampling Part 3 Guidance on safety《土壤质量 取样 第3部分 安全指南》.pdf
  • GOST R 53092-2008 Quality management systems Guidelines for process improvements in health service organizations《质量管理体系 保健服务机构的过程改进指南》.pdf GOST R 53092-2008 Quality management systems Guidelines for process improvements in health service organizations《质量管理体系 保健服务机构的过程改进指南》.pdf
  • GOST R 53109-2008 Information security of the public communications network providing system Passport of the organization communications of information security《公共通信网络提供系统的信息安全 机构通.pdf GOST R 53109-2008 Information security of the public communications network providing system Passport of the organization communications of information security《公共通信网络提供系统的信息安全 机构通.pdf
  • GOST R 53110-2008 Information security of the public communications network providing system General principles《公共通信网络提供系统的信息安全 总则》.pdf GOST R 53110-2008 Information security of the public communications network providing system General principles《公共通信网络提供系统的信息安全 总则》.pdf
  • GOST R 53111-2008 Stability of functioning of the public communications network Requirements and check methods《大众通信网络功能的稳定性 要求和检查方法》.pdf GOST R 53111-2008 Stability of functioning of the public communications network Requirements and check methods《大众通信网络功能的稳定性 要求和检查方法》.pdf
  • GOST R 53112-2008 Information protection Facilities for measuring side electromagnetic radiation and pickup parameters Technical requirements and test methods《信息保护 测量扇区电磁辐射和传感器参数的工.pdf GOST R 53112-2008 Information protection Facilities for measuring side electromagnetic radiation and pickup parameters Technical requirements and test methods《信息保护 测量扇区电磁辐射和传感器参数的工.pdf
  • GOST R 53113 1-2008 Information technology Protection of information technology and automated systems against security threats posed by use of covert channels Part 1 General princi.pdf GOST R 53113 1-2008 Information technology Protection of information technology and automated systems against security threats posed by use of covert channels Part 1 General princi.pdf
  • GOST R 53113 2-2009 Information technology Protection of information technology and automated systems against security threats posed by use of covert channels Part 2 Recommendationolog.pdf GOST R 53113 2-2009 Information technology Protection of information technology and automated systems against security threats posed by use of covert channels Part 2 Recommendationolog.pdf
  • GOST R 53114-2008 Protection of information Information security provision in organizations Basic terms and definitions《信息保护措施 机构的信息安全条款 基础术语和定义》.pdf GOST R 53114-2008 Protection of information Information security provision in organizations Basic terms and definitions《信息保护措施 机构的信息安全条款 基础术语和定义》.pdf
  • 相关搜索

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

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