[计算机类试卷]国家三级(网络技术)机试模拟试卷198及答案与解析.doc

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

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

2、于32,则字符保持不变,否则用 Y对应的字符代替。 注意;部分源程序已给出。 原始数据文件存放的格式是;每行的宽度均小于 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() voi

3、d 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)return 1; while(fgets(inBufi, COL+1, fp)!= NULL) P=strchr(inBufi, n); if(p)*P= 0; i+; totleLine=i; fclose(fp); return 0; void WriteData(void) FILE*fp; int i; fp=fopen(“OUT DAT“, “w“); for(i=0; i=a inBufij=z)continue; 若符合条件,不进行转换 else inBufij=y;否则进行转换 【试题解析】 本题考查的主要是字符与其对应的 ASCII码之间的转换及对ASCII码进行操作。首先计算出每行字符串的长度,再根据替换规则进行相应的替换。

展开阅读全文
相关资源
猜你喜欢
  • ANSI UL 120404-2012 UL Standard for Safety Pressurized Enclosures (First Edition Reprint with revisions through and including November 13 2015).pdf ANSI UL 120404-2012 UL Standard for Safety Pressurized Enclosures (First Edition Reprint with revisions through and including November 13 2015).pdf
  • ANSI UL 1206-2003 UL Standard for Safety Electric Commercial Clothes-Washing Equipment (Fourth Edition Reprint with Revisions Through and Including March 16 2018)《商用电动洗衣设备的安全性标准》.pdf ANSI UL 1206-2003 UL Standard for Safety Electric Commercial Clothes-Washing Equipment (Fourth Edition Reprint with Revisions Through and Including March 16 2018)《商用电动洗衣设备的安全性标准》.pdf
  • ANSI UL 121201-2017 UL Standard for Safety Nonincendive Electrical Equipment for Use in Class I and II Division 2 and Class III Divisions 1 and 2 Hazardous (Classified) Locations (.pdf ANSI UL 121201-2017 UL Standard for Safety Nonincendive Electrical Equipment for Use in Class I and II Division 2 and Class III Divisions 1 and 2 Hazardous (Classified) Locations (.pdf
  • ANSI UL 121203-2011 UL Standard for Safety Portable Electronic Products Suitable for Use in Class I and II Division 2 Class I Zone 2 and Class III Division 1 and 2 Hazardous (Class.pdf ANSI UL 121203-2011 UL Standard for Safety Portable Electronic Products Suitable for Use in Class I and II Division 2 Class I Zone 2 and Class III Division 1 and 2 Hazardous (Class.pdf
  • ANSI UL 122-2007 UL Standard for Safety Photographic Equipment (Fifth Edition Reprint with Revisions Through and Including July 27 2015)《摄影设备(推荐日期2006-11-17)》.pdf ANSI UL 122-2007 UL Standard for Safety Photographic Equipment (Fifth Edition Reprint with Revisions Through and Including July 27 2015)《摄影设备(推荐日期2006-11-17)》.pdf
  • ANSI UL 122001-2014 UL Standard for Safety General Requirements for Electrical Ignition Systems for Internal Combustion Engines in Class I Division 2 or Zone 2 Hazardous (Classifie.pdf ANSI UL 122001-2014 UL Standard for Safety General Requirements for Electrical Ignition Systems for Internal Combustion Engines in Class I Division 2 or Zone 2 Hazardous (Classifie.pdf
  • ANSI UL 122701-2017 UL Standard for Safety Requirements for Process Sealing Between Electrical Systems and Flammable or Combustible Process Fluids (Third Edition).pdf ANSI UL 122701-2017 UL Standard for Safety Requirements for Process Sealing Between Electrical Systems and Flammable or Combustible Process Fluids (Third Edition).pdf
  • ANSI UL 123-2007 UL Standard for Safety Oxy-Fuel Gas Torches (Eleventh Edition Reprint with Revisions Through and Including September 30 2014)《氧燃料气焊枪标准》.pdf ANSI UL 123-2007 UL Standard for Safety Oxy-Fuel Gas Torches (Eleventh Edition Reprint with Revisions Through and Including September 30 2014)《氧燃料气焊枪标准》.pdf
  • ANSI UL 1236-2015 UL Standard for Safety Battery Chargers for Charging Engine-Starter Batteries (Eighth Edition Reprint with revisions through and including March 2 2016)《装载发电机启动器蓄.pdf ANSI UL 1236-2015 UL Standard for Safety Battery Chargers for Charging Engine-Starter Batteries (Eighth Edition Reprint with revisions through and including March 2 2016)《装载发电机启动器蓄.pdf
  • 相关搜索

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

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