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

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

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

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

3、eChar() 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=strehr(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 y=z)con tinue; 若符合条件,不进行转换 else inBufij=y;否则进行转换 【试题解析】 本题考查的主要是字符与其对应的 ASCII码之间的转换及对ASCII码进行操作。首先计算出每行字符串的长度。再根据替换规则进行相应的替换。

展开阅读全文
相关资源
猜你喜欢
  • ASD-STAN PREN 4083-1995 Aerospace Series Nuts Bihexagonal Self-Locking Reduced Height with Counterbore in Heat Resisting Steel MoS2 Lubricated Classification  1 100 MPa (at Ambient.pdf ASD-STAN PREN 4083-1995 Aerospace Series Nuts Bihexagonal Self-Locking Reduced Height with Counterbore in Heat Resisting Steel MoS2 Lubricated Classification 1 100 MPa (at Ambient.pdf
  • ASD-STAN PREN 4084-1993 Aerospace Series Nuts Anchor Self-Locking Fixed Two Lug with Counterbore in Alloy Steel Cadmium Plated MoS2 Lubricated Classification 1 100 MPa (at Ambient .pdf ASD-STAN PREN 4084-1993 Aerospace Series Nuts Anchor Self-Locking Fixed Two Lug with Counterbore in Alloy Steel Cadmium Plated MoS2 Lubricated Classification 1 100 MPa (at Ambient .pdf
  • ASD-STAN PREN 4085-2001 Aerospace Series Nickel Base Alloy NI-B40002 Filler Metal for Brazing Amorphous Foil (Edition P 2 Supersedes Edition P 1 January 1994)《航空航天系列 钎焊用镍基合金NI-B400.pdf ASD-STAN PREN 4085-2001 Aerospace Series Nickel Base Alloy NI-B40002 Filler Metal for Brazing Amorphous Foil (Edition P 2 Supersedes Edition P 1 January 1994)《航空航天系列 钎焊用镍基合金NI-B400.pdf
  • ASD-STAN PREN 4086-1997 Aerospace Series Heat Resisting Alloy Ni-PD2101 (NiCo14Nb5Ti2) Non Heat Treated Forging Stock a or D Less Than or Equal to 360 mm (Edition P 1)《航空航天系列 a或D≤3.pdf ASD-STAN PREN 4086-1997 Aerospace Series Heat Resisting Alloy Ni-PD2101 (NiCo14Nb5Ti2) Non Heat Treated Forging Stock a or D Less Than or Equal to 360 mm (Edition P 1)《航空航天系列 a或D≤3.pdf
  • ASD-STAN PREN 4087-1998 Aerospace Series Heat Resisting Alloy NI-PD2101 (NiCo14Nb5Ti2) Solution Treated and Precipitation Treated Forgings De Less Than or Equal to 75 mm Rm Greater.pdf ASD-STAN PREN 4087-1998 Aerospace Series Heat Resisting Alloy NI-PD2101 (NiCo14Nb5Ti2) Solution Treated and Precipitation Treated Forgings De Less Than or Equal to 75 mm Rm Greater.pdf
  • ASD-STAN PREN 4088-1997 Aerospace Series Steel FE-PL5101 (13MoCrNiV4-4-3-1) Vacuum Induction Melted and Vacuum Arc Remelted Carburized Hardened Sub-Zero Treated and Tempered Bar fo.pdf ASD-STAN PREN 4088-1997 Aerospace Series Steel FE-PL5101 (13MoCrNiV4-4-3-1) Vacuum Induction Melted and Vacuum Arc Remelted Carburized Hardened Sub-Zero Treated and Tempered Bar fo.pdf
  • ASD-STAN PREN 4089-1997 Aerospace Series Steel FE-PL5101 (13MoCrNiV4-4-3-1) Vacuum Induction Melted and Vacuum Arc Remelted Softened Forging Stock a or D Less Than or Equal to 150 .pdf ASD-STAN PREN 4089-1997 Aerospace Series Steel FE-PL5101 (13MoCrNiV4-4-3-1) Vacuum Induction Melted and Vacuum Arc Remelted Softened Forging Stock a or D Less Than or Equal to 150 .pdf
  • ASD-STAN PREN 4090-1997 Aerospace Series Steel FE-PL5101 (13MoCrNiV4-4-3-1) Vacuum Induction Melted and Vacuum Arc Remelted Carburized Hardened Sub-Zero Treated and Tempered Forgin.pdf ASD-STAN PREN 4090-1997 Aerospace Series Steel FE-PL5101 (13MoCrNiV4-4-3-1) Vacuum Induction Melted and Vacuum Arc Remelted Carburized Hardened Sub-Zero Treated and Tempered Forgin.pdf
  • ASD-STAN PREN 4092-1998 Aerospace Series Heat Resisting Alloy NI-PH3901 (NiCr25Mo 10) Air Melted and Vacuum Refined Annealed Sheet and Strip 0 25 mm Less Than or Equal to a Less Th.pdf ASD-STAN PREN 4092-1998 Aerospace Series Heat Resisting Alloy NI-PH3901 (NiCr25Mo 10) Air Melted and Vacuum Refined Annealed Sheet and Strip 0 25 mm Less Than or Equal to a Less Th.pdf
  • 相关搜索

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

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