【计算机类职业资格】国家二级(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 之间的素数,并求出素数的平方根,然后求得这些平方根的和。

展开阅读全文
相关资源
猜你喜欢
  • NF C32-500-1998 Cables for signs and luminous-discharge-tube installations operating from no-load rated output voltage exceeding 1 kV but not exceeding 10 kV 《无负荷额定输出电压1KV至10KV的信号和.pdf NF C32-500-1998 Cables for signs and luminous-discharge-tube installations operating from no-load rated output voltage exceeding 1 kV but not exceeding 10 kV 《无负荷额定输出电压1KV至10KV的信号和.pdf
  • NF C32-902-1998 Insulated cables and cords for installations Power cable accessories intended for industry for rated voltage 0 6 1(1 2) kV Test methods and test requirements 《设备用绝缘.pdf NF C32-902-1998 Insulated cables and cords for installations Power cable accessories intended for industry for rated voltage 0 6 1(1 2) kV Test methods and test requirements 《设备用绝缘.pdf
  • NF C33-001-1993 Insulated cables and their accessories for power systems-electrical accessories for synthetic insulated cables with rated voltages from 1 8 3(3 6)kV up to 18 30(36).pdf NF C33-001-1993 Insulated cables and their accessories for power systems-electrical accessories for synthetic insulated cables with rated voltages from 1 8 3(3 6)kV up to 18 30(36).pdf
  • NF C33-005-2005 Test methods for accessories for power cables with rated voltages from 6 kV (Um = 7 2 kV) up to 36 kV (Um = 42 kV) 《额定电压6-36kV(Um=7 2-42kV)的电力电缆附件的试验方法》.pdf NF C33-005-2005 Test methods for accessories for power cables with rated voltages from 6 kV (Um = 7 2 kV) up to 36 kV (Um = 42 kV) 《额定电压6-36kV(Um=7 2-42kV)的电力电缆附件的试验方法》.pdf
  • NF C33-009-1-2008 Electric cables - Accessories - Material characterisation - Part 1  fingerprinting and type tests for resinous compounds 《电缆 配件 材料特性 第1部分 树脂化合物用指纹识别和类型试验》.pdf NF C33-009-1-2008 Electric cables - Accessories - Material characterisation - Part 1 fingerprinting and type tests for resinous compounds 《电缆 配件 材料特性 第1部分 树脂化合物用指纹识别和类型试验》.pdf
  • NF C33-009-2-2008 Electric cables - Accessories - Material characterization - Part 2  fingerprinting and type tests for heat shrinkable components for low voltage applications 《电缆 .pdf NF C33-009-2-2008 Electric cables - Accessories - Material characterization - Part 2 fingerprinting and type tests for heat shrinkable components for low voltage applications 《电缆 .pdf
  • NF C33-010-1993 Insulated cables and their accessories for power systems - Filling compounds polymerisable at ambient temperature cast or injected for cable accessories of rated vo.pdf NF C33-010-1993 Insulated cables and their accessories for power systems - Filling compounds polymerisable at ambient temperature cast or injected for cable accessories of rated vo.pdf
  • NF C33-014-1995 Insulated cables and their accessories for power systems Screen tape for single-core cables of rated voltages from 6 10 (12) kv to 18 30 (36) kv 《电力系统用绝缘电缆及其附件 额定电压.pdf NF C33-014-1995 Insulated cables and their accessories for power systems Screen tape for single-core cables of rated voltages from 6 10 (12) kv to 18 30 (36) kv 《电力系统用绝缘电缆及其附件 额定电压.pdf
  • NF C33-100 AM1-1967 INSULATED CONDUCTORS FOR POWER SYSTEMS IMPREGNATED PAPER-INSULATED LEAD-SHEATHED CABLES 《电力网用绝缘或保护电缆 电力网用缘缘导线 浸渍纸缘铅包电缆》.pdf NF C33-100 AM1-1967 INSULATED CONDUCTORS FOR POWER SYSTEMS IMPREGNATED PAPER-INSULATED LEAD-SHEATHED CABLES 《电力网用绝缘或保护电缆 电力网用缘缘导线 浸渍纸缘铅包电缆》.pdf
  • 相关搜索

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

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