【计算机类职业资格】二级C语言-555及答案解析.doc

上传人:feelhesitate105 文档编号:1325399 上传时间:2019-10-17 格式:DOC 页数:7 大小:35KB
下载 相关 举报
【计算机类职业资格】二级C语言-555及答案解析.doc_第1页
第1页 / 共7页
【计算机类职业资格】二级C语言-555及答案解析.doc_第2页
第2页 / 共7页
【计算机类职业资格】二级C语言-555及答案解析.doc_第3页
第3页 / 共7页
【计算机类职业资格】二级C语言-555及答案解析.doc_第4页
第4页 / 共7页
【计算机类职业资格】二级C语言-555及答案解析.doc_第5页
第5页 / 共7页
点击查看更多>>
资源描述

1、二级 C 语言-555 及答案解析(总分:30.00,做题时间:90 分钟)一、填空题(总题数:1,分数:1.00)1.请补充函数 fun(),该函数的功能是按条件删除一个字符串指定字符一半的数目,具体要求如下:如果该字符串所包含的指定字符的个数是奇数,则不予删除,如果其数目是偶数,则删除原串后半部分的指定字符。其中,a 指向原字符串,删除后的字符串存放在 b 所指的数组中,c 中存放指定的字符。 例如:当 a 输入“abababa”,ca时,b 的输出为“ababb”; 如果 a 的输入为“ababa”,则 b 的输出为“ababa”。 注意:部分源程序给出如下。 请勿改动主函数 main

2、和其他函数中的任何内容,仅在函数 fun()的横线上填入所编写的若干表达式或语句。 试题程序: #includestdioh #includeconioh #define LEN 80 void fun(char a,char b,char C) int i=0,j=0; int n=0; int m=0; while(ai!=/0) if(ai=c) n+; i+; _ 1_ ; if(n%2) while(aj!=“/0“) bj=aj; j+; bj=“/0“; else while(ai!=“/0“) bj+=ai; if(ai=c) m+; if(mn/2) if(n%2) while(aj!=“/0“) bj=aj; j+; bj=“/0“; else while(ai!=“/0“) bj+=ai; if(ai=c) m+; if(mn/2)i=n-1;i+) /*循环右移 n-p 次*/ t=wn-11; for(j=n-2;j=0;j-) /*实现循环右移*/ wj+1=wj; w0=t; 解析 本题采用“循环右移”的算法。和我们在前面分析的稍有不同的是,个是整型数组,个是字符型数组。

展开阅读全文
相关资源
猜你喜欢
  • NF Z42-010-1-1992 Electronic imaging - Scanning of office documents - part1 Subcontracting of scanning - Guide to detailed technical instructions for bureaux《电子影象 办公文件的扫描 第1部分 扫描的分.pdf NF Z42-010-1-1992 Electronic imaging - Scanning of office documents - part1 Subcontracting of scanning - Guide to detailed technical instructions for bureaux《电子影象 办公文件的扫描 第1部分 扫描的分.pdf
  • NF Z42-013-2009 Electronic archival storage - Specifications relative to the design and operation of information processing systems in view of ensuring the storage and integrity of.pdf NF Z42-013-2009 Electronic archival storage - Specifications relative to the design and operation of information processing systems in view of ensuring the storage and integrity of.pdf
  • NF Z43-005-1984 Micrographics Visual density of microfilms Method of measurement and values 《缩微照相 缩微胶片的目视密度 测量方法和数值》.pdf NF Z43-005-1984 Micrographics Visual density of microfilms Method of measurement and values 《缩微照相 缩微胶片的目视密度 测量方法和数值》.pdf
  • NF Z43-010-1984 Micrographics Legibility test for microform readers Description and use of iso micromire iso no 1 《缩微照相 缩微文件阅读器的清晰度检验 1号规格ISO缩微测试卡的说明和使用》.pdf NF Z43-010-1984 Micrographics Legibility test for microform readers Description and use of iso micromire iso no 1 《缩微照相 缩微文件阅读器的清晰度检验 1号规格ISO缩微测试卡的说明和使用》.pdf
  • NF Z43-011-1990 Micrographics Iso character and iso test chart no 1 Description and use 《缩微照相 1号的ISO字符和ISO测试图表 描述和使用》.pdf NF Z43-011-1990 Micrographics Iso character and iso test chart no 1 Description and use 《缩微照相 1号的ISO字符和ISO测试图表 描述和使用》.pdf
  • NF Z43-033-1988 Micrographics A6-size microfiche source document and com 《缩微照相 源文献和COM A6幅面缩微平片》.pdf NF Z43-033-1988 Micrographics A6-size microfiche source document and com 《缩微照相 源文献和COM A6幅面缩微平片》.pdf
  • NF Z43-051-1981 MICROFILMING OF DOCUMENTS IN BLACK AND WHITE ON 35 MM ROLL MICROFILM 《35mm胶卷黑白缩微照相》.pdf NF Z43-051-1981 MICROFILMING OF DOCUMENTS IN BLACK AND WHITE ON 35 MM ROLL MICROFILM 《35mm胶卷黑白缩微照相》.pdf
  • NF Z43-053-1981 Microfilming of newspapers on 35 mm microfilm for archival purposes 《存档用的35毫米缩微胶卷的报纸缩微照相》.pdf NF Z43-053-1981 Microfilming of newspapers on 35 mm microfilm for archival purposes 《存档用的35毫米缩微胶卷的报纸缩微照相》.pdf
  • NF Z43-055-1984 Micrographics Microfilming of technical drawings of elongated size 《缩微照相 放大规格的技术图纸的缩微照相》.pdf NF Z43-055-1984 Micrographics Microfilming of technical drawings of elongated size 《缩微照相 放大规格的技术图纸的缩微照相》.pdf
  • 相关搜索
    资源标签

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

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