[计算机类试卷]国家二级C语言机试(操作题)模拟试卷350(无答案).doc

上传人:syndromehi216 文档编号:846905 上传时间:2019-02-21 格式:DOC 页数:3 大小:27.50KB
下载 相关 举报
[计算机类试卷]国家二级C语言机试(操作题)模拟试卷350(无答案).doc_第1页
第1页 / 共3页
[计算机类试卷]国家二级C语言机试(操作题)模拟试卷350(无答案).doc_第2页
第2页 / 共3页
[计算机类试卷]国家二级C语言机试(操作题)模拟试卷350(无答案).doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

1、国家二级 C 语言机试(操作题)模拟试卷 350(无答案)一、程序填空题1 给定程序中,函数 fun 的功能是:计算出形参 s 所指字符串中包含的单词个数,作为函数值返回。为便于统计,规定各单词之间用空格隔开。例如,形参 s 所指的字符串为:This is a C languageprogram ,函数的返回值为6。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文件夹下的 BLANK1C 中。不得增行或删行,也不得更改程序的结构!#include int fun (char *s) int n=0,flag=0 ;_1_ ; flag=1 ; _3

2、return n;main () char str81; int n:printf (“nEnter a line text:n“) ;gets (str) ;n=fun (str) ;printf(“nThere are d words inthis textnn“,n) ;二、程序修改题2 给定程序 MODI1C 中函数 fun 的功能是:从 n(形参)个学生的成绩中统计出低于平均分的学生人数,此人数由函数值返回,平均分存放在形参 aver 所指的存储单元中。例如,若输入 8 名学生的成绩:805 60 72 905 98 515 88 64则低于平均分的学生人数为:4(平均分为:75

3、5625)。请改正程序中的错误,使它能统计出正确的结果。注意:不要改动 main 函数,不得增行或删行,也不得更改程序的结构!#include #define N 20int fun (float *s,int n,float*aver) float ave,t =00 ;int count = 0,k,i ;t = sk;ave t / n ;if (si void fun (int *s, int t, int *k)main()int a10=876,675f 896 ,101,301,401,980,431,451,777,k;void NONO();fun (a, 10, &k);printf(“d, dn“, k, ak);NONO();void NONO ()/*本函数用于打开文件,输入测试数据,调用 fun 函数,输出数据,关闭文件。*/int a10, i,k,j ;FILE *rf, *wf ;rf= fopen “indat“,“r“);wf=fopen (“outdat“, “w“);for(i = 0 ; i 10 ; i+) for(j=0 ; j 10 ; j+) fscanf(rf, “d“,aj);fun (a, 10, &k);fprintf (wf, “d,dn“,k,ak);fclose (rf);fclose (wf);

展开阅读全文
相关资源
猜你喜欢
  • ASD-STAN PREN 6067-2000 Aerospace Series Pin Quick Release Self-Retaining Positive Locking Double Acting Button Handle (Edition P 2)《航空航天系列 带双动按钮把手的强制联锁自固定快卸销 第P2版》.pdf ASD-STAN PREN 6067-2000 Aerospace Series Pin Quick Release Self-Retaining Positive Locking Double Acting Button Handle (Edition P 2)《航空航天系列 带双动按钮把手的强制联锁自固定快卸销 第P2版》.pdf
  • ASD-STAN PREN 6068-2000 Aerospace Series Pin Quick Release Self-Retaining Positive Locking Single Acting Button Handle (Edition P 2)《航空航天系列 带单动按钮把手的强制联锁自固定快卸销 第P2版》.pdf ASD-STAN PREN 6068-2000 Aerospace Series Pin Quick Release Self-Retaining Positive Locking Single Acting Button Handle (Edition P 2)《航空航天系列 带单动按钮把手的强制联锁自固定快卸销 第P2版》.pdf
  • ASD-STAN PREN 6069-2008 Aerospace series Rivet 100 Degrees reduced flush head close tolerance Inch series (Edition P 3)《航空航天系列 紧公差100°小埋头铆钉 英制系列 第P3版》.pdf ASD-STAN PREN 6069-2008 Aerospace series Rivet 100 Degrees reduced flush head close tolerance Inch series (Edition P 3)《航空航天系列 紧公差100°小埋头铆钉 英制系列 第P3版》.pdf
  • ASD-STAN PREN 6070-1998 Aerospace Series Aluminium and Aluminium Alloy Wrought Products Technical Specification General Requirements (Edition P 1)《航空航天系列 铝和铝合金压力加工制品 技术规范 一般要求 第P1版.pdf ASD-STAN PREN 6070-1998 Aerospace Series Aluminium and Aluminium Alloy Wrought Products Technical Specification General Requirements (Edition P 1)《航空航天系列 铝和铝合金压力加工制品 技术规范 一般要求 第P1版.pdf
  • ASD-STAN PREN 6071-1998 Aerospace Series Aluminium and Aluminium Alloy Wrought Products Technical Specification Plate (Edition P 1)《航空航天系列 铝和铝合金压力加工制品 技术规范 厚板材 第P1版》.pdf ASD-STAN PREN 6071-1998 Aerospace Series Aluminium and Aluminium Alloy Wrought Products Technical Specification Plate (Edition P 1)《航空航天系列 铝和铝合金压力加工制品 技术规范 厚板材 第P1版》.pdf
  • ASD-STAN PREN 6072-2008 Aerospace series Metallic materials Test methods Constant amplitude fatigue testing (Edition P 2)《航空航天系列 金属材料的试验方法 等幅疲劳试验 第P2版》.pdf ASD-STAN PREN 6072-2008 Aerospace series Metallic materials Test methods Constant amplitude fatigue testing (Edition P 2)《航空航天系列 金属材料的试验方法 等幅疲劳试验 第P2版》.pdf
  • ASD-STAN PREN 6073-1998 Aerospace Series Metallic Materials Aluminium and Aluminium Alloys Test Methods Drop Test (Edition P 1)《航空航天系列 金属材料 铝和铝合金的试验方法 跌落试验 第P1版》.pdf ASD-STAN PREN 6073-1998 Aerospace Series Metallic Materials Aluminium and Aluminium Alloys Test Methods Drop Test (Edition P 1)《航空航天系列 金属材料 铝和铝合金的试验方法 跌落试验 第P1版》.pdf
  • ASD-STAN PREN 6074-1998 Aerospace Series Metallic Materials Test Methods Statistical Data for Material Qualification (Edition P 1)《航空航天系列 金属材料的试验方法 材料质量评定的统计数据 第P1版》.pdf ASD-STAN PREN 6074-1998 Aerospace Series Metallic Materials Test Methods Statistical Data for Material Qualification (Edition P 1)《航空航天系列 金属材料的试验方法 材料质量评定的统计数据 第P1版》.pdf
  • ASD-STAN PREN 6075-2015 Aerospace series Static seal elements O-Ring ethylene-propylene moulded phosphate ester resistant (- 55 to 107 Inch series (Edition P 2).pdf ASD-STAN PREN 6075-2015 Aerospace series Static seal elements O-Ring ethylene-propylene moulded phosphate ester resistant (- 55 to 107 Inch series (Edition P 2).pdf
  • 相关搜索
    资源标签

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

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