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

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

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

2、0,则字符保持不变,否则用 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() void mai

3、n() system(“CLS“); if(ReadData() print(“IN DAT cant be open! n 007“); return; replaceChar(); WriteData(); int ReadData(void) FILE*fp; int i=0, j=0; char*P; if(fp=open(“IN DAT“, “r“)=NULL)return 1; while(gets(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; i130)continue; else inBufij=y; 按条件来转换 【试题解析】 本题主要考查字符与其对应的 ASCII码之间的转换及对 ASCII码进行操作。先计算出每行字符串的长度,再根据替换规则进行相应的替换。

展开阅读全文
相关资源
猜你喜欢
  • ANSI UL 10A-2009 UL Standard for Safety Tin-Clad Fire Doors (Twenty First Edition Reprint with revisions through and including December 10 2013)《镀锡防火门标准》.pdf ANSI UL 10A-2009 UL Standard for Safety Tin-Clad Fire Doors (Twenty First Edition Reprint with revisions through and including December 10 2013)《镀锡防火门标准》.pdf
  • ANSI UL 10B-2008 UL Standard for Safety Fire Tests of Door Assemblies (Tenth Edition Reprint with Revisions Through and Including February 16 2015)《门附件的燃烧试验的安全标准》.pdf ANSI UL 10B-2008 UL Standard for Safety Fire Tests of Door Assemblies (Tenth Edition Reprint with Revisions Through and Including February 16 2015)《门附件的燃烧试验的安全标准》.pdf
  • ANSI UL 10C-2016 UL Standard for Safety Positive Pressure Fire Tests of Door Assemblies (Third Edition).pdf ANSI UL 10C-2016 UL Standard for Safety Positive Pressure Fire Tests of Door Assemblies (Third Edition).pdf
  • ANSI UL 10D-2014 UL Standard for Safety Fire Tests of Fire Protective Curtain Assemblies (First Edition Reprint with revisions through and including July 22 2014)《防火卷帘总成的燃烧试验用安全性标准.pdf ANSI UL 10D-2014 UL Standard for Safety Fire Tests of Fire Protective Curtain Assemblies (First Edition Reprint with revisions through and including July 22 2014)《防火卷帘总成的燃烧试验用安全性标准.pdf
  • ANSI UL 10D-2017 UL Standard for Safety Fire Tests of Fire-Protective Curtain Assemblies (Second Edition).pdf ANSI UL 10D-2017 UL Standard for Safety Fire Tests of Fire-Protective Curtain Assemblies (Second Edition).pdf
  • ANSI UL 1123-2008 UL Standard for Safety Marine Buoyant Devices (Seventh Edition Reprint with Revisions Through and Including June 22 2017)《海上浮力装置的安全标准》.pdf ANSI UL 1123-2008 UL Standard for Safety Marine Buoyant Devices (Seventh Edition Reprint with Revisions Through and Including June 22 2017)《海上浮力装置的安全标准》.pdf
  • ANSI UL 1175-2007 UL Standard for Safety Buoyant Cushions (Fourth Edition Reprint with Revisions Through and Including October 21 2014)《浮力垫安全性的标准》.pdf ANSI UL 1175-2007 UL Standard for Safety Buoyant Cushions (Fourth Edition Reprint with Revisions Through and Including October 21 2014)《浮力垫安全性的标准》.pdf
  • ANSI UL 1177-2007 UL Standard for Safety Buoyant Vests (Third Edition Reprint with Revisions Through and Including October 30 2015)《救生衣的安全标准》.pdf ANSI UL 1177-2007 UL Standard for Safety Buoyant Vests (Third Edition Reprint with Revisions Through and Including October 30 2015)《救生衣的安全标准》.pdf
  • ANSI UL 1180-2009 UL Standard for Safety Fully Inflatable Recreational Personal Flotation Devices (Second Edition Reprint with Revisions Through and Including June 30 2017)《完全充足气的个.pdf ANSI UL 1180-2009 UL Standard for Safety Fully Inflatable Recreational Personal Flotation Devices (Second Edition Reprint with Revisions Through and Including June 30 2017)《完全充足气的个.pdf
  • 相关搜索

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

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