[计算机类试卷]国家二级C语言机试(操作题)模拟试卷135及答案与解析.doc

上传人:fatcommittee260 文档编号:498052 上传时间:2018-11-28 格式:DOC 页数:4 大小:58KB
下载 相关 举报
[计算机类试卷]国家二级C语言机试(操作题)模拟试卷135及答案与解析.doc_第1页
第1页 / 共4页
[计算机类试卷]国家二级C语言机试(操作题)模拟试卷135及答案与解析.doc_第2页
第2页 / 共4页
[计算机类试卷]国家二级C语言机试(操作题)模拟试卷135及答案与解析.doc_第3页
第3页 / 共4页
[计算机类试卷]国家二级C语言机试(操作题)模拟试卷135及答案与解析.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

1、国家二级 C语言机试(操作题)模拟试卷 135及答案与解析 一、程序填空题 1 函数 fun的功能是:计算 直到-6若 x=2 5,函数值为: 1 917915 o 请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。 注意:源程序存放在考生文件夹下的BLANK1 C中。 不得增行或删行,也不得更改程序的结构 ! #include #include double fun(double x) double f, t, int n; f=1 0+x; *found* t=_1_; n=1; do n+;*found* t*=(-1 0)*x _2_; f+=t; *found*

2、while(_3_=le-6); return f; main() double x, y; x=2 5; y=fun(x); printf(“inThe result is: in“); print f(“x= -12 6f y= -12 6fin“, x, y); 二、程序修改题 2 给定程序 MODI1 C中函数 fun的功能是:求整数 x的 y次方的低 3位值。例如,整数 5的 6次方为 15625,此值的低 3位值为 625。 请改正函数 fun中指定部位的错误,使它能得出正确的结果。 注意:不要改动 main函数,不得增行或删行,也不得更改程序的结构 ! #include long fun (int x, int Y, long *p) int i; long t=1; *found* for(i=1; i=0 000001) *绝对 值是否满足条件 * xn=xn*x*(0 5-n+1) n; *表达式分解 以后 xn=(xn-1)*x*(0 5-n+1) n* n+=1; sn+=xn; *sn累加上 xn* return(sn); 【试题解析】 (1)根据题干中给出的数列,推出每一项分子是在前一项分子的基础上乘以 (0 5-n+1)*x,分母则为阶乘,也就是在前一项分母的基础上乘以 n。 (2)在循环中求得每一项,然后对其进行累加求和。

展开阅读全文
相关资源
猜你喜欢
  • AECMA PREN 2346-004-2001 Aerospace Series Cable Electrical Fire Resistant Operating Temperatures between -65 Degrees C and 260 Degrees C Part 004 DN Family Single UV Laser Printabl.pdf AECMA PREN 2346-004-2001 Aerospace Series Cable Electrical Fire Resistant Operating Temperatures between -65 Degrees C and 260 Degrees C Part 004 DN Family Single UV Laser Printabl.pdf
  • AECMA PREN 2346-005-2005 Aerospace series Cable electrical fire resistant Operating temperatures between - 65 degrees C and 260 degrees C Part 005 DW family single UV laser printab.pdf AECMA PREN 2346-005-2005 Aerospace series Cable electrical fire resistant Operating temperatures between - 65 degrees C and 260 degrees C Part 005 DW family single UV laser printab.pdf
  • AECMA PREN 2346-1986 Aerospace Series Fire Resistant Electrical Cables Dimensions Conductor Resistance and Mass Issue P 1《航空航天系列.耐火电缆尺寸导体和质量P.第1版》.pdf AECMA PREN 2346-1986 Aerospace Series Fire Resistant Electrical Cables Dimensions Conductor Resistance and Mass Issue P 1《航空航天系列.耐火电缆尺寸导体和质量P.第1版》.pdf
  • AECMA PREN 2347-1996 Aerospace Series Flexible Hose Assemblies in Polytetrafluoroethylene (PTFE) - Type 4 - Technical Specification Edition P 1 Corrigendum 2 07 02 1998《航空航天系列聚四氟乙烯.pdf AECMA PREN 2347-1996 Aerospace Series Flexible Hose Assemblies in Polytetrafluoroethylene (PTFE) - Type 4 - Technical Specification Edition P 1 Corrigendum 2 07 02 1998《航空航天系列聚四氟乙烯.pdf
  • AECMA PREN 2349-1995 Aerospace Series Requirements and Test Procedures for Switching Devices Edition P 1《航空航天系列.开关装置要求和试验程序.P1版》.pdf AECMA PREN 2349-1995 Aerospace Series Requirements and Test Procedures for Switching Devices Edition P 1《航空航天系列.开关装置要求和试验程序.P1版》.pdf
  • AECMA PREN 2349-201-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 201 Visual Inspection Edition P 1《航空航天系列继电器和接触器要求和试验程序.第201部分 目测.P1版》.pdf AECMA PREN 2349-201-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 201 Visual Inspection Edition P 1《航空航天系列继电器和接触器要求和试验程序.第201部分 目测.P1版》.pdf
  • AECMA PREN 2349-202-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 202 Examination of Dimensions and Mass Edition P 1《航空航天系列继电器和接触器要求和试验程序.第2.pdf AECMA PREN 2349-202-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 202 Examination of Dimensions and Mass Edition P 1《航空航天系列继电器和接触器要求和试验程序.第2.pdf
  • AECMA PREN 2349-301-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 301 Pick-Up and Drop-Out Voltage Edition P 1《航空航天系列继电器和接触器要求和试验程序.第301部分 接.pdf AECMA PREN 2349-301-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 301 Pick-Up and Drop-Out Voltage Edition P 1《航空航天系列继电器和接触器要求和试验程序.第301部分 接.pdf
  • AECMA PREN 2349-302-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 302 Insulation Resistance Edition P 1《航空航天系列继电器和接触器要求和试验程序.第302部分 绝缘电阻.P1版.pdf AECMA PREN 2349-302-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 302 Insulation Resistance Edition P 1《航空航天系列继电器和接触器要求和试验程序.第302部分 绝缘电阻.P1版.pdf
  • 相关搜索

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

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