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

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

1、计算机三级网络技术机试(上机操作)模拟试卷 30及答案与解析 一、程序设计题 1 文件 IN DAT中存有一篇英文文章,函数 ReadData()负责将 IN DAT中的数据读到数组 inBuf中。请编制函数 replaceChar(),该函数的功能是:以行为单位把字符串中的所有大写字母改成该字母的下一个字母,字母 Z成字母 A。要求大写字母仍为大写字母,小写字母仍为小写字母,其他字符不变。把已处理的字符串仍按行重新存入字符串数组 inBuf中,函数 WriteData()负责将 inBuf中的数据输出到文件 OUT DAT中并且在屏幕上打出。 例如: s字符串中原有的内容为: my name

2、 is Lin Tao Nice to meet you则调用该函数后,结果为: my name is Min Uao Oice to meet you 原始数据文件存放的格式是:每行的宽度均小于 80个字符,含标点符号和空格。 注意:部分源程序已给出。 请勿改动主函数 main()、读函数 ReadData()和写函数 WriteData()的内容。 试题程序: #include #include #include #include #define LINE 70 #define COL 80 char inBufLINECOL+I; int totleLine=0;文章的总行数 int R

3、eadData(void); void WriteData(void); void replaceChar() void main() system(“CLS”); if(ReadData() print(“IN DAT cant he open! n 007”); return; replaceChar(); WriteData(); int ReadData(void) FILE*fp; int i=0; char*P; if(fp=open(“IN DAT”, “r”)=NULL)re turn 1; while(fgets(inBufi, COL+1, fp)!=NULL) P=str

4、chr(inBufi, n); if(p)*P= 0; i+; totleLine=i; close(fp); return 0; void WriteData(void) FILE*fp; int i; fp=open(“OUT DAT”, “W”); for(i=0; i=A inBufiEj=Z) 如果字符在 A Z之间 if(inBufij=Z)inBufij=A: 如果是字符 Z,则用 A来代替 else inBufij=(char)(int)inBufij+1); 其他情况则用其后面的字符代替 【试题解析】 本题主要考查字符与其对应的 ASCII码之间的转换及时 ASCII码进行操作。 程序步骤: 依据条件选择 inBufij,将其进行类型强制转换成整型 (也即所对应的 ASCII码值 )。 将 ASCII码值加 1或减 1以将该字符的 AsClI码值换成其下一位的 ASCII码值,将计算所得结果再转换成字符型存储到 inBufij中。

展开阅读全文
相关资源
猜你喜欢
  • BS PD ISO PAS 15339-1-2015 Graphic technology Printing from digital data across multiple technologies Principles《印刷技术 多技术的数字数据打印 原理》.pdf BS PD ISO PAS 15339-1-2015 Graphic technology Printing from digital data across multiple technologies Principles《印刷技术 多技术的数字数据打印 原理》.pdf
  • BS PD ISO PAS 15339-2-2015 Graphic technology Printing from digital data across multiple technologies Characterized reference printing conditions CRPC1-CRPC7《印刷技术 多技术的数字数据打印 有特征的参考印刷条件 CRPC1-CRPC7.pdf BS PD ISO PAS 15339-2-2015 Graphic technology Printing from digital data across multiple technologies Characterized reference printing conditions CRPC1-CRPC7《印刷技术 多技术的数字数据打印 有特征的参考印刷条件 CRPC1-CRPC7.pdf
  • BS PD ISO PAS 19295-2016 Electrically propelled road vehicles Specification of voltage sub-classes for voltage class B《电动道路车辆 用于电压等级B的电压子类规格》.pdf BS PD ISO PAS 19295-2016 Electrically propelled road vehicles Specification of voltage sub-classes for voltage class B《电动道路车辆 用于电压等级B的电压子类规格》.pdf
  • BS PD ISO PAS 19450-2015 Automation systems and integration Object-Process Methodology《自动化系统和集成 对象过程方法》.pdf BS PD ISO PAS 19450-2015 Automation systems and integration Object-Process Methodology《自动化系统和集成 对象过程方法》.pdf
  • BS PD ISO PAS 19451-1-2016 Application of ISO 26262 2011-2012 to semiconductors Application of concepts《ISO 26262-2011-2012半导体应用 概念应用》.pdf BS PD ISO PAS 19451-1-2016 Application of ISO 26262 2011-2012 to semiconductors Application of concepts《ISO 26262-2011-2012半导体应用 概念应用》.pdf
  • BS PD ISO PAS 19451-2-2016 Application of ISO 26262 2011-2012 to semiconductors Application of hardware qualification《ISO 26262-2011-2012半导体应用 硬件认证应用》.pdf BS PD ISO PAS 19451-2-2016 Application of ISO 26262 2011-2012 to semiconductors Application of hardware qualification《ISO 26262-2011-2012半导体应用 硬件认证应用》.pdf
  • BS PD ISO PAS 19695-2015 Motorcycles Functional safety《摩托车 功能安全》.pdf BS PD ISO PAS 19695-2015 Motorcycles Functional safety《摩托车 功能安全》.pdf
  • BS PD ISO PAS 20065-2016 Acoustics Objective method for assessing the audibility of tones in noise Engineering method《声学 利用客观法评定声音音调的可听度 工程方法》.pdf BS PD ISO PAS 20065-2016 Acoustics Objective method for assessing the audibility of tones in noise Engineering method《声学 利用客观法评定声音音调的可听度 工程方法》.pdf
  • BS PD ISO TR 10688-2015 Paper board and pulps Basic terms and equations for optical properties《纸 纸板和纸浆 光学性能的基本术语和公式》.pdf BS PD ISO TR 10688-2015 Paper board and pulps Basic terms and equations for optical properties《纸 纸板和纸浆 光学性能的基本术语和公式》.pdf
  • 相关搜索

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

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