[计算机类试卷]计算机三级网络技术机试(上机操作)模拟试卷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 4318-1997 Aerospace Series Heat Resisting Alloy FE-PA2601 (X6NiCrTiMoV26-15) Solution Treated and Precipitation Treated Bar and Section De Less Than or Equal to 100 m.pdf ASD-STAN PREN 4318-1997 Aerospace Series Heat Resisting Alloy FE-PA2601 (X6NiCrTiMoV26-15) Solution Treated and Precipitation Treated Bar and Section De Less Than or Equal to 100 m.pdf
  • ASD-STAN PREN 4321-1999 Aerospace Series Bolts Double Hexagon Head with Lockwire Holes Relieved Shank Long Thread in Heat Resisting Nickel Base Alloy NI-PH2601 (Inconel 718) Silver.pdf ASD-STAN PREN 4321-1999 Aerospace Series Bolts Double Hexagon Head with Lockwire Holes Relieved Shank Long Thread in Heat Resisting Nickel Base Alloy NI-PH2601 (Inconel 718) Silver.pdf
  • ASD-STAN PREN 4322-1998 Aerospace Series Bolts Double Haxagon Head with Lockwire Holes Relieved Shank Long Thread in Titanium Alloy TI-P63 Anodized MoS2 Coated Strength Class 1 100.pdf ASD-STAN PREN 4322-1998 Aerospace Series Bolts Double Haxagon Head with Lockwire Holes Relieved Shank Long Thread in Titanium Alloy TI-P63 Anodized MoS2 Coated Strength Class 1 100.pdf
  • ASD-STAN PREN 4323-1998 Aerospace Series Screws 100 Degree Countersunk Head Six Lobe Recess Threaded to Head in Titanium Alloy TI-P63 Anodized MoS2 Coated Classification 900 MPa (a.pdf ASD-STAN PREN 4323-1998 Aerospace Series Screws 100 Degree Countersunk Head Six Lobe Recess Threaded to Head in Titanium Alloy TI-P63 Anodized MoS2 Coated Classification 900 MPa (a.pdf
  • ASD-STAN PREN 4324-1997 Aerospace Series Aluminium Alloy AL-W42201 Filler Metal for Welding Rod (Edition P 1)《航空航天系列 焊条用铝合金AL-W42201填料金属 第P1版》.pdf ASD-STAN PREN 4324-1997 Aerospace Series Aluminium Alloy AL-W42201 Filler Metal for Welding Rod (Edition P 1)《航空航天系列 焊条用铝合金AL-W42201填料金属 第P1版》.pdf
  • ASD-STAN PREN 4325-2001 Aerospace Series Heat Resisting Alloy NI-WH1302 (NiCr20Co13Mo4Ti3AI) Filler Metal for Welding Wire and Rod (Edition P 2)《航空航天系列 焊丝和焊条用耐热合金NI-WH1302(NiCr20Co.pdf ASD-STAN PREN 4325-2001 Aerospace Series Heat Resisting Alloy NI-WH1302 (NiCr20Co13Mo4Ti3AI) Filler Metal for Welding Wire and Rod (Edition P 2)《航空航天系列 焊丝和焊条用耐热合金NI-WH1302(NiCr20Co.pdf
  • ASD-STAN PREN 4326-2001 Aerospace Series Heat Resisting Alloy CO-WH4102 (CoCr28W20Ni5V1) Filler Metal for Welding Wire And Rod (Edition P 2 Supersedes Edition P 1 March 1997 )《航空航天.pdf ASD-STAN PREN 4326-2001 Aerospace Series Heat Resisting Alloy CO-WH4102 (CoCr28W20Ni5V1) Filler Metal for Welding Wire And Rod (Edition P 2 Supersedes Edition P 1 March 1997 )《航空航天.pdf
  • ASD-STAN PREN 4327-2001 Aerospace Series Heat Resisting Alloy CO-WH1401 (CoCr26Ni11W8) Filler Metal for Welding Wire and Rod (Edition P 2 Supersedes Edition P 1 March 1997 Replaced.pdf ASD-STAN PREN 4327-2001 Aerospace Series Heat Resisting Alloy CO-WH1401 (CoCr26Ni11W8) Filler Metal for Welding Wire and Rod (Edition P 2 Supersedes Edition P 1 March 1997 Replaced.pdf
  • ASD-STAN PREN 4328-1997 Aerospace Series Steel FE-WM1601 (X18CrWNi13-3-2) Filler Metal for Welding Wire and Rod (Edition P 1)《航空航天系列 焊丝和焊条用钢FE-WM1601(X18CrWNi13-3-2)填料金属 第P1版》.pdf ASD-STAN PREN 4328-1997 Aerospace Series Steel FE-WM1601 (X18CrWNi13-3-2) Filler Metal for Welding Wire and Rod (Edition P 1)《航空航天系列 焊丝和焊条用钢FE-WM1601(X18CrWNi13-3-2)填料金属 第P1版》.pdf
  • 相关搜索

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

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