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

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

1、国家二级( C语言)机试模拟试卷 268及答案与解析 一、程序填空题( 30分) 1 给定程序中,函数 fun的功能是:将形参 s所指字符串中的所有字母字符顺序前移,其他字符顺序后移,处理后新字符串的首地址作为函数值返回。 例如, s所指字符串为: asdl23fgh543df,处理后新字符串为: asdfghdfl23543。 请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。 注意:源程序存放在考生文件夹下的 BLANKl C中。 不得增行或删行,也不得 更改程序的结构 ! #include #include #include char *fun(char *s) in

2、t i, j, k, n; char *p, *t; n=strlen(s)+1; t=(char*)malloc(n*sizeof(char); p=(char*)malloc(n*sizeof(char); j=0; k=0; for(i=0; i=a)&(si=A)&(si #define N 20 int fun(float*s, int n, float *aver) float ave, t=0 0; int count=0, k, i; for(k=0; k=k,因此第二空处应为 “k”。 第三空:在 C语言中,字符串以 “0”结束,故第三处应为 “0”或 “0”。 二、程序 修改题( 30分) 2 【正确答案】 (1)t+=sk; (2)*aver=ave; 【试题解析】 (1)根据题目要求求出平均分,首先要求总分,要把所有学生成绩相加再求平均分,因此第一个标识下面的 “t=sk; “应改为 “t+=sk; “。 (2)根据题目可知,比较的结果中高于平均分的分数 ave放入指针 aver所指的地址单元中,而变量 Ave没有定义,因此第二标识下应将 “*aver=Ave; “改为“*aver=ave; “。

展开阅读全文
相关资源
猜你喜欢
  • ASD-STAN PREN 6049-003-1997 Aerospace Series Electrical Cables Installation Protection Sleeve in Meta-Aramid Fibres Part 003 Braided Tubular Expandable Product Standard (Edition P .pdf ASD-STAN PREN 6049-003-1997 Aerospace Series Electrical Cables Installation Protection Sleeve in Meta-Aramid Fibres Part 003 Braided Tubular Expandable Product Standard (Edition P .pdf
  • ASD-STAN PREN 6049-003-2016 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 003 Braided tubular expandable Product standard (Edition P .pdf ASD-STAN PREN 6049-003-2016 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 003 Braided tubular expandable Product standard (Edition P .pdf
  • ASD-STAN PREN 6049-004-1997 Aerospace Series Electrical Cables Installation Protection Sleeve in Meta-Aramid Fibres Part 004 Braided Tubular High Expandable Product Standard (Editi.pdf ASD-STAN PREN 6049-004-1997 Aerospace Series Electrical Cables Installation Protection Sleeve in Meta-Aramid Fibres Part 004 Braided Tubular High Expandable Product Standard (Editi.pdf
  • ASD-STAN PREN 6049-005-2005 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 005 Sleeve flexible post installation Product standard (Edi.pdf ASD-STAN PREN 6049-005-2005 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 005 Sleeve flexible post installation Product standard (Edi.pdf
  • ASD-STAN PREN 6049-006-2010 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 006 Self-wrapping protective sleeve flexible post installat.pdf ASD-STAN PREN 6049-006-2010 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 006 Self-wrapping protective sleeve flexible post installat.pdf
  • ASD-STAN PREN 6049-007-2010 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 007 Self-wrapping protective sleeve flexible post installat.pdf ASD-STAN PREN 6049-007-2010 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 007 Self-wrapping protective sleeve flexible post installat.pdf
  • ASD-STAN PREN 6049-008-2016 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 008 Self-wrapping shielded (EMI) protective sleeve with nic.pdf ASD-STAN PREN 6049-008-2016 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 008 Self-wrapping shielded (EMI) protective sleeve with nic.pdf
  • ASD-STAN PREN 6049-009-2013 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 009 Self-wrapping fire protection sleeve flexible post inst.pdf ASD-STAN PREN 6049-009-2013 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 009 Self-wrapping fire protection sleeve flexible post inst.pdf
  • ASD-STAN PREN 6050-2006 Aerospace Series Pins Close Tolerance Swage Locking 100 Degree Countersunk Head Reduced Shear Type in Aluminium Alloy 7050 Chemical Film Inch Series (Editio.pdf ASD-STAN PREN 6050-2006 Aerospace Series Pins Close Tolerance Swage Locking 100 Degree Countersunk Head Reduced Shear Type in Aluminium Alloy 7050 Chemical Film Inch Series (Editio.pdf
  • 相关搜索

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

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