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

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

1、计算机三级网络技术机试(上机操作)模拟试卷 75及答案与解析 一、程序设计题 1 文件 IN DAT中存有一篇英文文章,函数 ReadData()负责将 IN DAT中的数据读到数组 inBuf中。请编制函数 replaceChar()。该函数的功能是按照指定规则对字符进行替换。变换后的值仍存入 inBuf中。函数 WriteData()负责将 inBuf中的数据输出到文件 OUT DAT中并且在屏幕上打出。 替换规则为:先对字符的 ASCII码按公式 y=(a*11)rood 256进行运算 (a为某一字符的 ASCII码值。 y为变换后的 ASCII码值 ),如果原字符是大写字母或计算后

2、y的值小于等于 32,则字符保持不变,否则用 y代替 a。 注意:部分源程序已给出。 原始数据文件存放的格式是:每行的宽度均小于 80个字符。 请勿改动主函数 main()、读函数 ReadData()和写函数 WriteData()的内容。 试题程序: #include #include #include #include #define LINE 50 #define COL 80 char inBufLINECOL+1; int totleLine=0;文章的总行数 int ReadData(void); void WriteData(void); void replaceChar()

3、void main() ( system(“CLS”); if(ReadData() printf(“IN DAT cant be open! n 007”); return; replaceChar(); WriteData(); int ReadData(void) FILE*fp; int i=0; char*P; if(fp=fopen(“IN DAT”, “r”)=NULL)re turn 1; while(fgets(inBufi, COL+1, fp)!=NULL) P=strchr(inBufi, n); if(p)*P= 0; i+1 totleLine=i; fclose(fp); return 0; void WriteData(void) FILE*fp; int i; fp=fopen(“OUT DAT”, “W”); for(i=0; i=A inBuf ij=Z)continue! 在指定的条件下,不进行转换 else inBufij=y; 在其他情况下进行转换 【试题解析】 题主要考 查字符与其对应的 ASCII码之间的转换及对 ASClI码进行操作。 先计算出每行字符串的长度,再根据替换规则进行相应的替换。

展开阅读全文
相关资源
猜你喜欢
  • ASD-STAN PREN 2591-D2-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D2 - Shock (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第D2部分 冲击 第P1版》.pdf ASD-STAN PREN 2591-D2-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D2 - Shock (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第D2部分 冲击 第P1版》.pdf
  • ASD-STAN PREN 2591-D20-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D20 - Mechanical Strength of Rear Accessories (Issue P 1)《航空航天系列 电气和光学连.pdf ASD-STAN PREN 2591-D20-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D20 - Mechanical Strength of Rear Accessories (Issue P 1)《航空航天系列 电气和光学连.pdf
  • ASD-STAN PREN 2591-D24-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D24 - Stripping Force Solderless Wrapped Connections (Issue P 1)《航空航天系列.pdf ASD-STAN PREN 2591-D24-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D24 - Stripping Force Solderless Wrapped Connections (Issue P 1)《航空航天系列.pdf
  • ASD-STAN PREN 2591-D25-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D25 - Unwrapping Solderless Wrapped Connections (Issue P 1)《航空航天系列 电气和光.pdf ASD-STAN PREN 2591-D25-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D25 - Unwrapping Solderless Wrapped Connections (Issue P 1)《航空航天系列 电气和光.pdf
  • ASD-STAN PREN 2591-D26-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D26 - Contact Retention System Effectiveness (Removable Contact Walkout.pdf ASD-STAN PREN 2591-D26-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D26 - Contact Retention System Effectiveness (Removable Contact Walkout.pdf
  • ASD-STAN PREN 2591-D27-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D27 - Robustness of Protective Cover Attachment (Issue P 1)《航空航天系列 电气和光.pdf ASD-STAN PREN 2591-D27-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D27 - Robustness of Protective Cover Attachment (Issue P 1)《航空航天系列 电气和光.pdf
  • ASD-STAN PREN 2591-D28-1993 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D28 - Sinusoidal Vibrations with Passage of Current for Lugs and in-Lin.pdf ASD-STAN PREN 2591-D28-1993 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D28 - Sinusoidal Vibrations with Passage of Current for Lugs and in-Lin.pdf
  • ASD-STAN PREN 2591-D4-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D4 - Transverse Load (External Bending Moment) (Issue P 1)《航空航天系列 电气和光学连.pdf ASD-STAN PREN 2591-D4-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D4 - Transverse Load (External Bending Moment) (Issue P 1)《航空航天系列 电气和光学连.pdf
  • ASD-STAN PREN 2591-D5-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D5 - Axial Load (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第D5部分 轴向载荷 第P1版》.pdf ASD-STAN PREN 2591-D5-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part D5 - Axial Load (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第D5部分 轴向载荷 第P1版》.pdf
  • 相关搜索

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

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