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

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

1、国家三级(网络技术)机试模拟试卷 214及答案与解析 一、程序设计题 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或 y

2、对应的字符是数字 0 9,则字符保持不变,否则用 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)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=0&y=9)continue; 在指定的条件下,不进行转换 else inBufij=y; 在其他情况下进行转换 【试题解析】 本题主要考查字符与其对应的 ASCII码之间的转换及对 ASCII码进行操作。先计算出每行字符串的长度,再根据替换规则进行相应的替换。

展开阅读全文
相关资源
猜你喜欢
  • ASTM A632-2004 Standard Specification for Seamless and Welded Austenitic Stainless Steel Tubing (Small-Diameter) for General Service《通用无缝和焊接奥氏体不锈钢管(小直径)标准规范》.pdf ASTM A632-2004 Standard Specification for Seamless and Welded Austenitic Stainless Steel Tubing (Small-Diameter) for General Service《通用无缝和焊接奥氏体不锈钢管(小直径)标准规范》.pdf
  • ASTM A632-2004(2009) Standard Specification for Seamless and Welded Austenitic Stainless Steel Tubing (Small-Diameter) for General Service《通用无缝和焊接奥氏体不锈钢管(小直径)标准规范》.pdf ASTM A632-2004(2009) Standard Specification for Seamless and Welded Austenitic Stainless Steel Tubing (Small-Diameter) for General Service《通用无缝和焊接奥氏体不锈钢管(小直径)标准规范》.pdf
  • ASTM A632-2004(2014) Standard Specification for Seamless and Welded Austenitic Stainless Steel Tubing &40 Small-Diameter&41 for General Service《通用服务用无缝和焊接奥氏体不锈钢管 (小直径) 的标准规格》.pdf ASTM A632-2004(2014) Standard Specification for Seamless and Welded Austenitic Stainless Steel Tubing &40 Small-Diameter&41 for General Service《通用服务用无缝和焊接奥氏体不锈钢管 (小直径) 的标准规格》.pdf
  • ASTM A633 A633M-2001(2006) Standard Specification for Normalized High-Strength Low-Alloy Structural Steel Plates《标准化的高强度低合金钢板标准规范》.pdf ASTM A633 A633M-2001(2006) Standard Specification for Normalized High-Strength Low-Alloy Structural Steel Plates《标准化的高强度低合金钢板标准规范》.pdf
  • ASTM A633 A633M-2001(2011) Standard Specification for Normalized High-Strength Low-Alloy Structural Steel Plates《标准化的高强度低合金钢板标准规格》.pdf ASTM A633 A633M-2001(2011) Standard Specification for Normalized High-Strength Low-Alloy Structural Steel Plates《标准化的高强度低合金钢板标准规格》.pdf
  • ASTM A633 A633M-2013 Standard Specification for Normalized High-Strength Low-Alloy Structural Steel Plates《标准化的高强度低合金钢板标准规格》.pdf ASTM A633 A633M-2013 Standard Specification for Normalized High-Strength Low-Alloy Structural Steel Plates《标准化的高强度低合金钢板标准规格》.pdf
  • ASTM A633 A633M-2018 Standard Specification for Normalized High-Strength Low-Alloy Structural Steel Plates《标准化的高强度低合金钢板标准规格》.pdf ASTM A633 A633M-2018 Standard Specification for Normalized High-Strength Low-Alloy Structural Steel Plates《标准化的高强度低合金钢板标准规格》.pdf
  • ASTM A635 A635M-2007 Standard Specification for Steel Sheet and Strip Heavy-Thickness Coils Hot-Rolled Carbon Structural High-Strength Low-Alloy and High-Strength Low-Alloy with Im.pdf ASTM A635 A635M-2007 Standard Specification for Steel Sheet and Strip Heavy-Thickness Coils Hot-Rolled Carbon Structural High-Strength Low-Alloy and High-Strength Low-Alloy with Im.pdf
  • ASTM A635 A635M-2008 Standard Specification for Steel Sheet and Strip Heavy-Thickness Coils Hot-Rolled Alloy Carbon Structural High-Strength Low-Alloy and High-Strength Low-Alloy w.pdf ASTM A635 A635M-2008 Standard Specification for Steel Sheet and Strip Heavy-Thickness Coils Hot-Rolled Alloy Carbon Structural High-Strength Low-Alloy and High-Strength Low-Alloy w.pdf
  • 相关搜索

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

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