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

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

1、国家二级(C 语言)机试-试卷 96 及答案解析(总分:12.00,做题时间:90 分钟)一、程序填空题(总题数:2,分数:4.00)1.程序填空题()(分数:2.00)_2.函数 fun 的功能是:计算 的前 n 项。若 x25,函数值为:12182340。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文件夹下的BLANKlC 中。不得增行或删行,也不得更改程序的结构! (分数:2.00)_二、程序修改题(总题数:2,分数:4.00)3.程序修改题()(分数:2.00)_4.给定程序 MODllC 中函数 fun 的功能是:对 N 名学生的学习成

2、绩,按从高到低的顺序找出前 m(m10)名学生来,并将这些学生数据存放在一个动态分配的连续存储区中,此存储区的首地址作为函数值返回。 请改正函数 fun 中指定部位的错误,使它能得出正确的结果。 注意:不要改动 main 函数,不得增行或删行,也不得更改程序的结构! (分数:2.00)_三、程序设计题(总题数:2,分数:4.00)5.程序设计题()(分数:2.00)_6.请编写函数 fun,其功能是:计算并输出 3 到 n 之间(含 3 和 n)所有素数的平方根之和。例如,在主函数中从键盘给 n 输入 100 后,输出为:sum=148874270。注意:要求 n 的值大于 2 但不大于 10

3、0。部分源程序在文件 PROGlC 中。请勿改动主函数 main 和其他函数中的任何内容,仅在函数 fun 的花括号中填入你编写的若干语句。 (分数:2.00)_国家二级(C 语言)机试-试卷 96 答案解析(总分:12.00,做题时间:90 分钟)一、程序填空题(总题数:2,分数:4.00)1.程序填空题()(分数:2.00)_解析:2.函数 fun 的功能是:计算 的前 n 项。若 x25,函数值为:12182340。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文件夹下的BLANKlC 中。不得增行或删行,也不得更改程序的结构! (分数:2.

4、00)_正确答案:(正确答案:(1)1 (2)1 (3)i)解析:解析:本题中函数的功能是求级数和,级数项的变化规律是:后一项是在前一项的基础上乘以 x 除以 n。二、程序修改题(总题数:2,分数:4.00)3.程序修改题()(分数:2.00)_解析:4.给定程序 MODllC 中函数 fun 的功能是:对 N 名学生的学习成绩,按从高到低的顺序找出前 m(m10)名学生来,并将这些学生数据存放在一个动态分配的连续存储区中,此存储区的首地址作为函数值返回。 请改正函数 fun 中指定部位的错误,使它能得出正确的结果。 注意:不要改动 main 函数,不得增行或删行,也不得更改程序的结构! (分

5、数:2.00)_正确答案:(正确答案:(1)t(STU*)calloc(sizeof(sTu),m); (2)tkbj;)解析:解析:本题中函数的功能是按学习成绩从高到低的顺序找出前 m(m10)名学生。利用循环结构实现对定义的结构体中的成绩域进行排序。三、程序设计题(总题数:2,分数:4.00)5.程序设计题()(分数:2.00)_解析:6.请编写函数 fun,其功能是:计算并输出 3 到 n 之间(含 3 和 n)所有素数的平方根之和。例如,在主函数中从键盘给 n 输入 100 后,输出为:sum=148874270。注意:要求 n 的值大于 2 但不大于 100。部分源程序在文件 PROGlC 中。请勿改动主函数 main 和其他函数中的任何内容,仅在函数 fun 的花括号中填入你编写的若干语句。 (分数:2.00)_正确答案:(正确答案: )解析:解析:函数 fun 的功能是计算并输出 3 到 n 之间(含 3 和 n)所有素数的平方根之和,首先根据题干中的要求找出 3 到 n 之间的素数,并求出素数的平方根,然后求得这些平方根的和。

展开阅读全文
相关资源
猜你喜欢
  • DIN EN ISO 24234-2015 Dentistry - Dental amalgam (ISO 24234 2015) German version EN ISO 24234 2015《牙科学 牙科汞合金(ISO 24234-2015) 德文版本EN ISO 24234-2015》.pdf DIN EN ISO 24234-2015 Dentistry - Dental amalgam (ISO 24234 2015) German version EN ISO 24234 2015《牙科学 牙科汞合金(ISO 24234-2015) 德文版本EN ISO 24234-2015》.pdf
  • DIN EN ISO 24276-2013 Foodstuffs - Methods of analysis for the detection of genetically modified organisms and derived products - General requirements and definitions (ISO 24276 20.pdf DIN EN ISO 24276-2013 Foodstuffs - Methods of analysis for the detection of genetically modified organisms and derived products - General requirements and definitions (ISO 24276 20.pdf
  • DIN EN ISO 24333 Berichtigung 1-2010 Cereals and cereal products - Sampling (ISO 24333 2009) German version EN ISO 24333 2009 Corrigendum to DIN EN ISO 24333 2010-04 German version.pdf DIN EN ISO 24333 Berichtigung 1-2010 Cereals and cereal products - Sampling (ISO 24333 2009) German version EN ISO 24333 2009 Corrigendum to DIN EN ISO 24333 2010-04 German version.pdf
  • DIN EN ISO 24333-2010 Cereals and cereal products - Sampling (ISO 24333 2009) German version EN ISO 24333 2009《谷类及谷类制品 抽样》.pdf DIN EN ISO 24333-2010 Cereals and cereal products - Sampling (ISO 24333 2009) German version EN ISO 24333 2009《谷类及谷类制品 抽样》.pdf
  • DIN EN ISO 24340-2012 Resilient floor coverings - Determination of thickness of layers (ISO 24340 2006) German version EN ISO 24340 2012《弹性覆地材料 层厚测定》.pdf DIN EN ISO 24340-2012 Resilient floor coverings - Determination of thickness of layers (ISO 24340 2006) German version EN ISO 24340 2012《弹性覆地材料 层厚测定》.pdf
  • DIN EN ISO 24341-2012 Resilient and textile floor coverings - Determination of length width and straightness of sheet (ISO 24341 2006) German version EN ISO 24341 2012《弹性织物地板覆盖物 覆盖.pdf DIN EN ISO 24341-2012 Resilient and textile floor coverings - Determination of length width and straightness of sheet (ISO 24341 2006) German version EN ISO 24341 2012《弹性织物地板覆盖物 覆盖.pdf
  • DIN EN ISO 24342-2013 Resilient and textile floor-coverings - Determination of side length edge straightness and squareness of tiles (ISO 24342 2007 + Amd 1 2012) German version EN.pdf DIN EN ISO 24342-2013 Resilient and textile floor-coverings - Determination of side length edge straightness and squareness of tiles (ISO 24342 2007 + Amd 1 2012) German version EN.pdf
  • DIN EN ISO 24343-1-2012 Resilient and laminate floor coverings - Determination of indentation and residual indentation - Part 1 Residual indentation (ISO 24343-1 2007) German versi.pdf DIN EN ISO 24343-1-2012 Resilient and laminate floor coverings - Determination of indentation and residual indentation - Part 1 Residual indentation (ISO 24343-1 2007) German versi.pdf
  • DIN EN ISO 24344-2012 Resilient floor coverings - Determination of flexibility and deflection (ISO 24344 2008) German version EN ISO 24344 2012《弹性覆地材料 挠性与挠曲度测定》.pdf DIN EN ISO 24344-2012 Resilient floor coverings - Determination of flexibility and deflection (ISO 24344 2008) German version EN ISO 24344 2012《弹性覆地材料 挠性与挠曲度测定》.pdf
  • 相关搜索

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

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