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

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

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

2、数 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 #include #define N 81 fun(char *s) NONO() *请在此函数内打开文件,输入测试数据,调用 fun函数,输出数据,关闭文件。 * int i; char aN; FILE *rf, *wf; rf=fopen(“in dat”, “r”); wf=fopen(“out dat”, “w”); for(i=0; i=0; j-)bi+= sj; strcpy(s, b); 【试题解析】 该程序功能是字符串中的内容逆置。把字符串中字符逆置,就是把字符串中的第一个元素和最后一个元素交换,第二个元素和倒数第二个元素交换,直到所有元素交换完成为止。

展开阅读全文
相关资源
猜你喜欢
  • AECMA PREN 2752-1986 Aerospace Series Nuts Anchor Self Locking Fixed Two Lug Reduced Series with Counterbore Classification 1100 MPa 235 Degrees Celsius Edition 1《航空和航天系列自锁固定双接片带扩孔.pdf AECMA PREN 2752-1986 Aerospace Series Nuts Anchor Self Locking Fixed Two Lug Reduced Series with Counterbore Classification 1100 MPa 235 Degrees Celsius Edition 1《航空和航天系列自锁固定双接片带扩孔.pdf
  • AECMA PREN 2753-1987 Aerospace Series Nuts Anchor Self Locking One Lug with Counterbore Classification 1100 MPa 235 Degrees Celsius Issue P 1《航空和航天系列自锁固定单接片带扩孔锚等级 1100MPa 235℃》.pdf AECMA PREN 2753-1987 Aerospace Series Nuts Anchor Self Locking One Lug with Counterbore Classification 1100 MPa 235 Degrees Celsius Issue P 1《航空和航天系列自锁固定单接片带扩孔锚等级 1100MPa 235℃》.pdf
  • AECMA PREN 2754-1987 Aerospace Series Nuts Anchor Self Locking Two Lug Floating with Counterbore Classification 1100 MPa 235 Degrees Celsius Issue P 1《航空和航天系列自锁固定双片带扩孔锚等级 1100MPa 2.pdf AECMA PREN 2754-1987 Aerospace Series Nuts Anchor Self Locking Two Lug Floating with Counterbore Classification 1100 MPa 235 Degrees Celsius Issue P 1《航空和航天系列自锁固定双片带扩孔锚等级 1100MPa 2.pdf
  • AECMA PREN 2756-1995 Aerospace Series Lamps Incandescent Tests Edition P 1《航空和航天系列白炽灯测试P1》.pdf AECMA PREN 2756-1995 Aerospace Series Lamps Incandescent Tests Edition P 1《航空和航天系列白炽灯测试P1》.pdf
  • AECMA PREN 2757-1991 Aerospace Series Test Method for Determining the Drying and Ignition Residues of Adhesive Primers Issue P 1《航空和航天系列粘性雷管的烘干和残渣灼烧试验方法》.pdf AECMA PREN 2757-1991 Aerospace Series Test Method for Determining the Drying and Ignition Residues of Adhesive Primers Issue P 1《航空和航天系列粘性雷管的烘干和残渣灼烧试验方法》.pdf
  • AECMA PREN 2759-1986 Aerospace Series Steel FE-PL80 1900 Less Than or Equal to Rm Less Than or Equal to 2100 MPa Forging De Less Than or Equal to 75 mm Issue P 1《航空和航天系列钢FE-PL80 19.pdf AECMA PREN 2759-1986 Aerospace Series Steel FE-PL80 1900 Less Than or Equal to Rm Less Than or Equal to 2100 MPa Forging De Less Than or Equal to 75 mm Issue P 1《航空和航天系列钢FE-PL80 19.pdf
  • AECMA PREN 2760-1986 Aerospace Series Steel FE-PL78 1760 Less Than or Equal to Rm Less Than or Equal to 2000 MPa Bar De Less Than or Equal to 75 mm Issue P 1《航空和航天系列钢FE-PL78 1760MP.pdf AECMA PREN 2760-1986 Aerospace Series Steel FE-PL78 1760 Less Than or Equal to Rm Less Than or Equal to 2000 MPa Bar De Less Than or Equal to 75 mm Issue P 1《航空和航天系列钢FE-PL78 1760MP.pdf
  • AECMA PREN 2761-1986 Aerospace Series Steel FE-PL78 1760 Less Than or Equal to Rm Less Than or Equal to 2000 MPa Forging De Less Than or Equal to 75 mm Issue P 1《航空和航天系列钢FE-PL78 17.pdf AECMA PREN 2761-1986 Aerospace Series Steel FE-PL78 1760 Less Than or Equal to Rm Less Than or Equal to 2000 MPa Forging De Less Than or Equal to 75 mm Issue P 1《航空和航天系列钢FE-PL78 17.pdf
  • AECMA PREN 2762-1986 Aerospace Series Steel FE-PL80 1900 Less Than or Equal to Rm Less Than or Equal to 2100 MPa Bar De Less Than or Equal to 75 mm Issue P 1《航空和航天系列钢FE-PL80 1760MP.pdf AECMA PREN 2762-1986 Aerospace Series Steel FE-PL80 1900 Less Than or Equal to Rm Less Than or Equal to 2100 MPa Bar De Less Than or Equal to 75 mm Issue P 1《航空和航天系列钢FE-PL80 1760MP.pdf
  • 相关搜索

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

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