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

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

1、国家二级(C 语言)机试-试卷 55 及答案解析(总分:12.00,做题时间:90 分钟)一、程序填空题(总题数:2,分数:4.00)1.程序填空题()(分数:2.00)_2.函数 fun 的功能是:计算 请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文件夹下的 BLANKlC 中。不得增行或删行,也不得更改程序的结构!(分数:2.00)_二、程序修改题(总题数:2,分数:4.00)3.程序修改题()(分数:2.00)_4.给定程序 MODllC 中函数 fun 的功能是:根据整型形参 m,计算如下公式的值。 例如,若m2000,则应输出:0000

2、160。 请改正程序中的语法错误,使它能计算出正确的结果。 注意:不要改动 main 函数,不得增行或删行,也不得更改程序的结构! (分数:2.00)_三、程序设计题(总题数:2,分数:4.00)5.程序设计题()(分数:2.00)_6.编写函数 fun,它的功能是计算下列级数和,和值由函数值返回。 例如,当 n=10,x=03 时,函数值为 1349859。注意:部分源程序在文件 PROGlC 文件中。请勿改动主函数 main 和其他函数中的任何内容,仅在函数 fun 的花括号中填入你编写的若干语句。 (分数:2.00)_国家二级(C 语言)机试-试卷 55 答案解析(总分:12.00,做题

3、时间:90 分钟)一、程序填空题(总题数:2,分数:4.00)1.程序填空题()(分数:2.00)_解析:2.函数 fun 的功能是:计算 请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文件夹下的 BLANKlC 中。不得增行或删行,也不得更改程序的结构!(分数:2.00)_正确答案:(正确答案:(1)x (2)n (3)fabs(t)解析:解析:函数 fun 的功能是计算级数和,观察可知,级数项的变化规律是,后一项乘以(-1)*x 然后除以 n。二、程序修改题(总题数:2,分数:4.00)3.程序修改题()(分数:2.00)_解析:4.给定程序

4、MODllC 中函数 fun 的功能是:根据整型形参 m,计算如下公式的值。 例如,若m2000,则应输出:0000160。 请改正程序中的语法错误,使它能计算出正确的结果。 注意:不要改动 main 函数,不得增行或删行,也不得更改程序的结构! (分数:2.00)_正确答案:(正确答案:(1)double fun(int m)(2)for(i=100; i=m; i+=100)解析:解析:本题中函数的功能是计算公式的值。关于题干公式的求解过程,首先根据题干中给出的公式推出每一项之间的关系,求出每一项的表达式,然后求得数列的值。三、程序设计题(总题数:2,分数:4.00)5.程序设计题()(分数:2.00)_解析:6.编写函数 fun,它的功能是计算下列级数和,和值由函数值返回。 例如,当 n=10,x=03 时,函数值为 1349859。注意:部分源程序在文件 PROGlC 文件中。请勿改动主函数 main 和其他函数中的任何内容,仅在函数 fun 的花括号中填入你编写的若干语句。 (分数:2.00)_正确答案:(正确答案: )解析:解析:该程序功能是计算并输出多项式值。根据题干中给出的数列,首先推出每一项的表达式,然后再对多项式进行累加求和。

展开阅读全文
相关资源
猜你喜欢
  • BS EN 16636-2015 Pest management services Requirements and competences《害虫治理服务 要求和能力》.pdf BS EN 16636-2015 Pest management services Requirements and competences《害虫治理服务 要求和能力》.pdf
  • BS EN 16640-2017 Bio-based products Bio-based carbon content Determination of the bio-based carbon content using the radiocarbon method《生物基质产品 生物基碳含量 使用放射性碳方法测定生物基碳含量》.pdf BS EN 16640-2017 Bio-based products Bio-based carbon content Determination of the bio-based carbon content using the radiocarbon method《生物基质产品 生物基碳含量 使用放射性碳方法测定生物基碳含量》.pdf
  • BS EN 16643-2016 Rubber and plastics hoses and hose assemblies Non-bonded fluoroplastic lined (e g PTFE) hoses and hose assemblies for liquid and gaseous chemicals Specification《橡胶.pdf BS EN 16643-2016 Rubber and plastics hoses and hose assemblies Non-bonded fluoroplastic lined (e g PTFE) hoses and hose assemblies for liquid and gaseous chemicals Specification《橡胶.pdf
  • BS EN 16644-2014 Pumps Rotodynamic pumps Glandless circulators having a rated power input not exceeding 200 W for heating installations and domestic hot water installations Noise tr.pdf BS EN 16644-2014 Pumps Rotodynamic pumps Glandless circulators having a rated power input not exceeding 200 W for heating installations and domestic hot water installations Noise tr.pdf
  • BS EN 16647-2015 Fireplaces for liquid fuels Decorative appliances producing a flame using alcohol based or gelatinous fuel Use in private households《液态燃料壁炉 使用醇基或胶状燃料生成火焰的装饰性器具 私人家.pdf BS EN 16647-2015 Fireplaces for liquid fuels Decorative appliances producing a flame using alcohol based or gelatinous fuel Use in private households《液态燃料壁炉 使用醇基或胶状燃料生成火焰的装饰性器具 私人家.pdf
  • BS EN 16648-2015 Conservation of cultural heritage Transport methods《文化遗产保护 运输方法》.pdf BS EN 16648-2015 Conservation of cultural heritage Transport methods《文化遗产保护 运输方法》.pdf
  • BS EN 16651-2015 Fertilizers Determination of N-(n-Butyl)thiophosphoric acid triamide (NBPT) and N-(n-Propyl)thiophosphoric acid triamide (NPPT) Method using high-performance liqui.pdf BS EN 16651-2015 Fertilizers Determination of N-(n-Butyl)thiophosphoric acid triamide (NBPT) and N-(n-Propyl)thiophosphoric acid triamide (NPPT) Method using high-performance liqui.pdf
  • BS EN 16652-1-2016 LPG equipment and accessories Automotive LPG vehicles workshops Working areas and procedures《液化石油气设备和附件 机动车用液化石油气车辆的车间 工作区和工作程序》.pdf BS EN 16652-1-2016 LPG equipment and accessories Automotive LPG vehicles workshops Working areas and procedures《液化石油气设备和附件 机动车用液化石油气车辆的车间 工作区和工作程序》.pdf
  • BS EN 16653-2015 Rubber or plastics-coated fabrics Determination of stitch tear resistance (using a needle) Test method《橡胶或塑料涂层织物 缝合抗撕裂性的测定 (使用针) 试验方法》.pdf BS EN 16653-2015 Rubber or plastics-coated fabrics Determination of stitch tear resistance (using a needle) Test method《橡胶或塑料涂层织物 缝合抗撕裂性的测定 (使用针) 试验方法》.pdf
  • 相关搜索
    资源标签

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

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