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

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

1、国家二级 C语言机试(操作题)模拟试卷 98及答案与解析 一、程序填空题 1 函数 fun的功能是:计算 的前 n项之和。若 x=2 5 n=15时,函数值为: 1 917914。 请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。 注意:源程序存放在考生文件夹下的 BLANK1 C中。 不得增行或删行,也不得更改程序的结构 !#include#includedouble fun(double x, int n) double f, t; int i;/*found*/ f= _1 _ ; t=-1 ; for (i=1; i 二、程序修改题 2 给定程序 MODI1 C中

2、函数 fun的功能是:从 3个红球, 5个白球, 6个黑球中任意取出 8个作为一组,进行输出。 在每组中,可以没有黑球,但必须要有红球和白球。 组合数作为函数值返回。正确的组合数应该是 15。程序中 i的值代表红球数, i的值代表白球数, k的值代表黑球数。 请改正函数 fun中指定部位的错误,使它能得出正确的结果。 注意:不要改动 main函数,不得增行或删行,也不得更改程序 的结构 ! #include int fun() int i, j, k, sum=0; prLntf(“nThe result : nn“); /*found*/ for(i=0; i=0 &K=0&k=1&K=0&k=6)”。 三、程序设计题 3 【正确答案】 double s=1; long t=1; int i; for(i=1; i=n; i+) t=t*i; /*计算阶乘 */ s+=1 /t; /*计算每项的值并累加至变量 s中 */ return s; /*返回 多项式的值 */ 【试题解析】 该程序功能是计算并输出多项式的值。该题的解题思路是,根据题干中给出的数列,首先推出每一项的表达式,然后再对多项式进行累加求和。

展开阅读全文
相关资源
猜你喜欢
  • ANSI UL 1598-2008 UL Standard for Safety Luminaires (Third Edition Reprint with revisions through and including October 17 2012)《照明设备》.pdf ANSI UL 1598-2008 UL Standard for Safety Luminaires (Third Edition Reprint with revisions through and including October 17 2012)《照明设备》.pdf
  • ANSI UL 1598A-2000 UL Standard for Safety Supplemental Requirements for Luminaires for Installation on Marine Vessels (First Edition Reprint with Revisions Through and Including Ap.pdf ANSI UL 1598A-2000 UL Standard for Safety Supplemental Requirements for Luminaires for Installation on Marine Vessels (First Edition Reprint with Revisions Through and Including Ap.pdf
  • ANSI UL 1598A-2005 Standard for Supplemental Requirements for Luminaires for Installation on Marine Vessels《海船装置用灯具的补充要求用标准》.pdf ANSI UL 1598A-2005 Standard for Supplemental Requirements for Luminaires for Installation on Marine Vessels《海船装置用灯具的补充要求用标准》.pdf
  • ANSI UL 1598B-2000 UL Standard for Safety Supplemental Requirements for Luminaire Reflector Kits for Installation on Previously Installed Fluorescent Luminaires (First Edition Repr.pdf ANSI UL 1598B-2000 UL Standard for Safety Supplemental Requirements for Luminaire Reflector Kits for Installation on Previously Installed Fluorescent Luminaires (First Edition Repr.pdf
  • ANSI UL 1598B-2005 Supplemental Requirements for Luminaire Reflector Kits for Installation on Previously Installed Fluorescent Luminaires《预装荧光灯具用照明反射组件的补充要求》.pdf ANSI UL 1598B-2005 Supplemental Requirements for Luminaire Reflector Kits for Installation on Previously Installed Fluorescent Luminaires《预装荧光灯具用照明反射组件的补充要求》.pdf
  • ANSI UL 1598C-2014 UL Standard for Safety Light-Emitting Diode (LED) Retrofit Luminaire Conversion Kits (First Edition Reprint with revisions through and including July 12 2017)《发光.pdf ANSI UL 1598C-2014 UL Standard for Safety Light-Emitting Diode (LED) Retrofit Luminaire Conversion Kits (First Edition Reprint with revisions through and including July 12 2017)《发光.pdf
  • ANSI UL 1602-2009 UL Standard for Safety Gasoline-Engine-Powered Rigid-Cutting-Member Edgers and Edger-Trimmers (Fourth Edition Reprint with Revisions Through and Including January.pdf ANSI UL 1602-2009 UL Standard for Safety Gasoline-Engine-Powered Rigid-Cutting-Member Edgers and Edger-Trimmers (Fourth Edition Reprint with Revisions Through and Including January.pdf
  • ANSI UL 1610-1998 UL Standard for Safety Central-Station Burglar-Alarm Units (Third Edition Reprint with Revisions Through and Including March 20 2015).pdf ANSI UL 1610-1998 UL Standard for Safety Central-Station Burglar-Alarm Units (Third Edition Reprint with Revisions Through and Including March 20 2015).pdf
  • ANSI UL 1610-2016 UL Standard for Safety Central-Station Burglar-Alarm Units (Fourth Edition).pdf ANSI UL 1610-2016 UL Standard for Safety Central-Station Burglar-Alarm Units (Fourth Edition).pdf
  • 相关搜索

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

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