【计算机类职业资格】三级网络技术机试-211及答案解析.doc

上传人:tireattitude366 文档编号:1321912 上传时间:2019-10-17 格式:DOC 页数:4 大小:28KB
下载 相关 举报
【计算机类职业资格】三级网络技术机试-211及答案解析.doc_第1页
第1页 / 共4页
【计算机类职业资格】三级网络技术机试-211及答案解析.doc_第2页
第2页 / 共4页
【计算机类职业资格】三级网络技术机试-211及答案解析.doc_第3页
第3页 / 共4页
【计算机类职业资格】三级网络技术机试-211及答案解析.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

1、三级网络技术机试-211 及答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.函数:ReadDat()实现从文件 IN.DAT中读取一篇英文文章存入到字符串数组 xx中,请编制函数ConvertCharD(),其函数的功能是:以行为单位把字符串中的所有小写字母改写成该字母的上一个字母,如果是字母 a,则改写成字母 z,其他字符保持不变。把已处理的字符串仍按行重新存入字符串数组 xx中。最后 main()函数调用函数 WriteDat()把结果 xx输出到文件 OUT.DAT中。例如,原文:Adb.Bcdzaabck.LLhj结果:Aca.Bbc

2、yzzabj.LLgi原始数据文件存放的格式是:每行的宽度均小于 80个字符,含标点符号和空格。注意:部分源程序存放在 PROG1.C中。请勿改动主函数 main()、读函数 ReadDat()和输出函数 WriteDat()的内容。试题程序#include #include char xx5080;int maxline=0; /*文章的总行数*/int ReadDat(void);void WriteDat(void);void ConvertCharD(void)void main()if (ReadDat() printf(“数据文件 IN.DAT不能打开!/n/007“);retur

3、n;ConvertCharD();WriteDat();int ReadDat(void)FILE *fp;int i=0;char *p;if(fp=fopen(“in.dat“,“r“)=NULL)return 1;while(fgets(xxi,80,fp)!=NULL)p=strchr(xxi,/n);if(p) *P=0;i+;maxline=i;fclose(fp);return 0;void WriteDat(void)FILE *fp;int i;fp=fopen(“out.dat“,“W“);for(i=0;imaxline;i+)printf(“%s/n“,xxi);fpr

4、intf(fp,“%s/n“,xxi);fclose(fp);(分数:100.00)_三级网络技术机试-211 答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.函数:ReadDat()实现从文件 IN.DAT中读取一篇英文文章存入到字符串数组 xx中,请编制函数ConvertCharD(),其函数的功能是:以行为单位把字符串中的所有小写字母改写成该字母的上一个字母,如果是字母 a,则改写成字母 z,其他字符保持不变。把已处理的字符串仍按行重新存入字符串数组 xx中。最后 main()函数调用函数 WriteDat()把结果 xx输出到文件 O

5、UT.DAT中。例如,原文:Adb.Bcdzaabck.LLhj结果:Aca.Bbcyzzabj.LLgi原始数据文件存放的格式是:每行的宽度均小于 80个字符,含标点符号和空格。注意:部分源程序存放在 PROG1.C中。请勿改动主函数 main()、读函数 ReadDat()和输出函数 WriteDat()的内容。试题程序#include #include char xx5080;int maxline=0; /*文章的总行数*/int ReadDat(void);void WriteDat(void);void ConvertCharD(void)void main()if (ReadDa

6、t() printf(“数据文件 IN.DAT不能打开!/n/007“);return;ConvertCharD();WriteDat();int ReadDat(void)FILE *fp;int i=0;char *p;if(fp=fopen(“in.dat“,“r“)=NULL)return 1;while(fgets(xxi,80,fp)!=NULL)p=strchr(xxi,/n);if(p) *P=0;i+;maxline=i;fclose(fp);return 0;void WriteDat(void)FILE *fp;int i;fp=fopen(“out.dat“,“W“);

7、for(i=0;imaxline;i+)printf(“%s/n“,xxi);fprintf(fp,“%s/n“,xxi);fclose(fp);(分数:100.00)_正确答案:(void ConvertCharD(void)int i,j; /*定义变量*/for(i=0;imaxline;1+) /*字符串改写*/for(j=0;j80;j+)if(xxijaelse xxij-;)解析:解析 本题要求逐行逐字对一篇英文文童进行处理,将其中的小写字母改写成相邻的字母。依据题意,应依次对每个字符检查,是小写字母的改写为它的上一个字母(即 ASC值减 1),如小写字母 a改写为小写字母 z,小写字母 b改写为小写字母 a。

展开阅读全文
相关资源
猜你喜欢
  • ITU-R M 1467-1 FRENCH-2006 Prediction of sea area A2 and NAVTEX ranges and protection of the A2 global maritime distress and safety system distress watch channel《海洋地区A2和航行警告电传(NAVT.pdf ITU-R M 1467-1 FRENCH-2006 Prediction of sea area A2 and NAVTEX ranges and protection of the A2 global maritime distress and safety system distress watch channel《海洋地区A2和航行警告电传(NAVT.pdf
  • ITU-R M 1467-1 SPANISH-2006 Prediction of sea area A2 and NAVTEX ranges and protection of the A2 global maritime distress and safety system distress watch channel《海洋地区A2和航行警告电传(NAV.pdf ITU-R M 1467-1 SPANISH-2006 Prediction of sea area A2 and NAVTEX ranges and protection of the A2 global maritime distress and safety system distress watch channel《海洋地区A2和航行警告电传(NAV.pdf
  • ITU-R M 1467-1-2006 Prediction of sea area A2 and NAVTEX ranges and protection of the A2 global maritime distress and safety system distress watch channel《海洋地区A2和NAVTEX范围预测以及A2全球海难.pdf ITU-R M 1467-1-2006 Prediction of sea area A2 and NAVTEX ranges and protection of the A2 global maritime distress and safety system distress watch channel《海洋地区A2和NAVTEX范围预测以及A2全球海难.pdf
  • ITU-R M 1469-2 SPANISH-2010 Methodology for evaluating potential for interference from time division multiple access frequency division multiple access (TDMA FDMA) mobile-satellitento .pdf ITU-R M 1469-2 SPANISH-2010 Methodology for evaluating potential for interference from time division multiple access frequency division multiple access (TDMA FDMA) mobile-satellitento .pdf
  • ITU-R M 1469-2-2010 Methodology for evaluating potential for interference from time division multiple access frequency division multiple access (TDMA FDMA) mobile-satellite service-of-.pdf ITU-R M 1469-2-2010 Methodology for evaluating potential for interference from time division multiple access frequency division multiple access (TDMA FDMA) mobile-satellite service-of-.pdf
  • ITU-R M 1470 FRENCH-2000 METHODOLOGY OF SHARING BETWEEN MSS SYSTEMS (EARTH-TO-SPACE) AND EXISTING RNSS SYSTEMS (SPACE-TO-EARTH) IN THE FREQUENCY BANDS 149 9-150 05 MHz AND 399 9-405 M.pdf ITU-R M 1470 FRENCH-2000 METHODOLOGY OF SHARING BETWEEN MSS SYSTEMS (EARTH-TO-SPACE) AND EXISTING RNSS SYSTEMS (SPACE-TO-EARTH) IN THE FREQUENCY BANDS 149 9-150 05 MHz AND 399 9-405 M.pdf
  • ITU-R M 1470 SPANISH-2000 METHODOLOGY OF SHARING BETWEEN MSS SYSTEMS (EARTH-TO-SPACE) AND EXISTING RNSS SYSTEMS (SPACE-TO-EARTH) IN THE FREQUENCY BANDS 149 9-150 05 MHz AND 399 9-405 .pdf ITU-R M 1470 SPANISH-2000 METHODOLOGY OF SHARING BETWEEN MSS SYSTEMS (EARTH-TO-SPACE) AND EXISTING RNSS SYSTEMS (SPACE-TO-EARTH) IN THE FREQUENCY BANDS 149 9-150 05 MHz AND 399 9-405 .pdf
  • ITU-R M 1470-2000 Methodology of Sharing between MSS Systems (Earth-to-Space) and Existing RNSS Systems (Space-to-Earth) in the Frequency Bands 149 9-150 05 MHz and 399 9-400 05 MH.pdf ITU-R M 1470-2000 Methodology of Sharing between MSS Systems (Earth-to-Space) and Existing RNSS Systems (Space-to-Earth) in the Frequency Bands 149 9-150 05 MHz and 399 9-400 05 MH.pdf
  • ITU-R M 1471-1 SPANISH-2010 Guide to the application of the methodologies to facilitate coordination and use of frequency bands shared between the mobile-satellite service and the 1-3 .pdf ITU-R M 1471-1 SPANISH-2010 Guide to the application of the methodologies to facilitate coordination and use of frequency bands shared between the mobile-satellite service and the 1-3 .pdf
  • 相关搜索

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

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