[计算机类试卷]计算机三级网络技术机试(上机操作)模拟试卷82及答案与解析.doc

上传人:fatcommittee260 文档编号:505747 上传时间:2018-11-29 格式:DOC 页数:3 大小:27KB
下载 相关 举报
[计算机类试卷]计算机三级网络技术机试(上机操作)模拟试卷82及答案与解析.doc_第1页
第1页 / 共3页
[计算机类试卷]计算机三级网络技术机试(上机操作)模拟试卷82及答案与解析.doc_第2页
第2页 / 共3页
[计算机类试卷]计算机三级网络技术机试(上机操作)模拟试卷82及答案与解析.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

1、计算机三级网络技术机试(上机操作)模拟试卷 82及答案与解析 一、程序设计题 1 文件 IN DAT中存有一篇英文文章,函数 ReadData()负责将 IN DAT中的数据读到数组 inBuf中。请编制函数 replaeeChar(),该函数的功能是:以行为单位把字符串的最后一个字符 ASCII值右移 4位后加最后第二个字符的 ASCII值,得到最后一个新的字符,最后第二个字符的 ASCII值右移 4位后加最后第三个字符的ASCII值,得到最后第二个新的字符,依此类推一直处理到第二个字符,第一个字符的 ASCII值加最后一个字符的 ASCII值,得到第一个新的字符,得到的新字符分别存放在原字

2、符串对应的位置上。把已处理的字符串仍按行重新存入字符串数组 inBuf中,函数 WriteData()负责将 inBuf中的数据输出到文件 OUT DAT中并且在屏幕上打出。 原始数据文件存放的格式是:每行的宽度均小于 80个字符,含标点符号和空格。 注意:部分源程序已给出。 请勿改动主函数 main()、读函数 ReadData()和写函数 WriteData()的内容。 试题程序: #include #include #include #include #define LlNE 50 #define COL 80 char inBufLINEC()L+1; int totleLine=0;

3、文章的总行数 int ReadData(void); void WriteData(void); void replaceChar() void main() system(“CLS”); if(ReadData() printf(“IN DAT cant be open! n 007”); return; replaceChar(); WriteData(); Int RcadData(void) FILE*fp; int i=0; char*P; if(fp=fopen(“IN DAT”, “r”)=NULL)re turn 1; while(fgets(inBufi, COL+1, fp

4、)!=NULL) P=strchr(inBufi, n); if(p)*P= 0; i+; tmleLine=i; fclose(fp); return 0; void WriteData(void) FILE*fp; int i; fp=fopen(“OUT DAT”, “W”); for(i=0; i0; j-) inBufili=(inBufij4)+inBufij-1; *其他情况下,则将该字符的 ASCII码 右移 4位再加上前一个字符的 ASCII码 * inBufi0+=last; 将整 型转换成字符型存入 inBuf中 【试题解析】 本题主要考查字符与其时应的 ASCII码之间的转换及时 ASCII码进行操作。 程序步骤: 计算出每行字符串的长度。 将字符串中最后一个保存在变量 last中。 按照指定的规则对字符串中除第一个以外的字符进行替代。 时第一个字符按照指定规则进行替代。

展开阅读全文
相关资源
猜你喜欢
  • ASTM C1742-2010 Standard Test Method for Isotopic Analysis of Uranium Hexafluoride by Double Standard Single-Collector Gas Mass Spectrometer Method《用双标准单收集器气体质谱仪法进行六氟化铀同位素分析的标准试验方法.pdf ASTM C1742-2010 Standard Test Method for Isotopic Analysis of Uranium Hexafluoride by Double Standard Single-Collector Gas Mass Spectrometer Method《用双标准单收集器气体质谱仪法进行六氟化铀同位素分析的标准试验方法.pdf
  • ASTM C1742-2017 Standard Test Method for Isotopic Analysis of Uranium Hexafluoride by Double Standard Single-Collector Gas Mass Spectrometer Method《采用双标准单收集器气相质谱仪法对六氟化铀进行同位素分析的标准试验.pdf ASTM C1742-2017 Standard Test Method for Isotopic Analysis of Uranium Hexafluoride by Double Standard Single-Collector Gas Mass Spectrometer Method《采用双标准单收集器气相质谱仪法对六氟化铀进行同位素分析的标准试验.pdf
  • ASTM C1743-2010 Standard Practice for Installation and Use of Radiant Barrier Systems (RBS) in Residential Building Construction《住宅建筑物构造用辐射屏蔽系统(RBS)的使用和安装的标准操作规程》.pdf ASTM C1743-2010 Standard Practice for Installation and Use of Radiant Barrier Systems (RBS) in Residential Building Construction《住宅建筑物构造用辐射屏蔽系统(RBS)的使用和安装的标准操作规程》.pdf
  • ASTM C1743-2012 Standard Practice for Installation and Use of Radiant Barrier Systems (RBS) in Residential Building Construction《住宅建筑物构造用辐射屏蔽系统(RBS)的使用和安装的标准实施规程》.pdf ASTM C1743-2012 Standard Practice for Installation and Use of Radiant Barrier Systems (RBS) in Residential Building Construction《住宅建筑物构造用辐射屏蔽系统(RBS)的使用和安装的标准实施规程》.pdf
  • ASTM C1744-2010 Standard Practice for Installation and Use of Radiant Barrier Systems (RBS) in Commercial Industrial Building Construction《商业 工业建筑物用辐射屏蔽系统(RBS)的使用和安装的标准操作规程》.pdf ASTM C1744-2010 Standard Practice for Installation and Use of Radiant Barrier Systems (RBS) in Commercial Industrial Building Construction《商业 工业建筑物用辐射屏蔽系统(RBS)的使用和安装的标准操作规程》.pdf
  • ASTM C1744-2012 Standard Practice for Installation and Use of Radiant Barrier Systems (RBS) in Commercial Industrial Building Construction《商业 工业建筑物用辐射屏蔽系统(RBS)的安装和使用的标准实施规程》.pdf ASTM C1744-2012 Standard Practice for Installation and Use of Radiant Barrier Systems (RBS) in Commercial Industrial Building Construction《商业 工业建筑物用辐射屏蔽系统(RBS)的安装和使用的标准实施规程》.pdf
  • ASTM C1745 C1745M-2011 Standard Test Method for Measurement of Hydraulic Characteristics of Hydrodynamic Stormwater Separators and Underground Settling Devices《水力暴雨水分离器和地下沉降装置水压特征的.pdf ASTM C1745 C1745M-2011 Standard Test Method for Measurement of Hydraulic Characteristics of Hydrodynamic Stormwater Separators and Underground Settling Devices《水力暴雨水分离器和地下沉降装置水压特征的.pdf
  • ASTM C1745 C1745M-2018 Standard Test Method for Measurement of Hydraulic Characteristics of Hydrodynamic Stormwater Separators and Underground Settling Devices《水力雨水分离器和地下沉降装置水力特性测量.pdf ASTM C1745 C1745M-2018 Standard Test Method for Measurement of Hydraulic Characteristics of Hydrodynamic Stormwater Separators and Underground Settling Devices《水力雨水分离器和地下沉降装置水力特性测量.pdf
  • ASTM C1746 C1746M-2012 Standard Test Method for Measurement of Suspended Sediment Removal Efficiency of Hydrodynamic Stormwater Separators and Underground Settling Devices《测试水动力雨水分.pdf ASTM C1746 C1746M-2012 Standard Test Method for Measurement of Suspended Sediment Removal Efficiency of Hydrodynamic Stormwater Separators and Underground Settling Devices《测试水动力雨水分.pdf
  • 相关搜索

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

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