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

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

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

2、y对应的字符是小写字母,则字符保持不变,否则用 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 replaceCh

3、ar() void main() system(“CLS“); if(readData() printf(“IN DAT cant be open! n 007“); return; replaceChar(); writeData(); ilit 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&y=Z)continue; 若符合条件,不进行转换 else inBufij=y;否则进行转换 【试题解析】 本题考查的主要是字符与其对应的 ASCII码之间的转换及对ASCII码进行操作。首先计算出每行字符串的长度,再根据替换规则进行相应的替换。

展开阅读全文
相关资源
猜你喜欢
  • ASHRAE DA-07-040-2007 A Semi-Automated Commissioning Tool for VAV Air-Handling Units Functional Test Analyzer《变风量空调处理机组半自动化的调试工具 功能测试仪》.pdf ASHRAE DA-07-040-2007 A Semi-Automated Commissioning Tool for VAV Air-Handling Units Functional Test Analyzer《变风量空调处理机组半自动化的调试工具 功能测试仪》.pdf
  • ASHRAE DA-07-041-2007 Characterization and Cancellation of Static Nonlinearity in HVAC Systems《在暖通空调系统中静态非线性表征和取消》.pdf ASHRAE DA-07-041-2007 Characterization and Cancellation of Static Nonlinearity in HVAC Systems《在暖通空调系统中静态非线性表征和取消》.pdf
  • ASHRAE DA-07-042-2007 Numverical Study of Air Movement in a Slot-Ventilated Enclosure《在槽通风圈地空气流动的Numverical研究》.pdf ASHRAE DA-07-042-2007 Numverical Study of Air Movement in a Slot-Ventilated Enclosure《在槽通风圈地空气流动的Numverical研究》.pdf
  • ASHRAE DA-07-043-2007 Implementation of Controller Area Networks for Monitoring of Animal Environments《监察动物的环境控制器区域网络应用》.pdf ASHRAE DA-07-043-2007 Implementation of Controller Area Networks for Monitoring of Animal Environments《监察动物的环境控制器区域网络应用》.pdf
  • ASHRAE DA-07-044-2007 Analysis of Airflow in a Full-Scale Room with Non-Isothermal Jet Ventilation Using PTV Techniques《用PTV技术 在一个全尺寸的室内非等温射流通风条件下的气流分析》.pdf ASHRAE DA-07-044-2007 Analysis of Airflow in a Full-Scale Room with Non-Isothermal Jet Ventilation Using PTV Techniques《用PTV技术 在一个全尺寸的室内非等温射流通风条件下的气流分析》.pdf
  • ASHRAE DA-07-045-2007 A Review of Ventilation and Air-Conditioning Technologies for Energy-Efficient Healthy Buildings in the Tropics《节能健康建筑物在热带的通风和空气调节技术审查》.pdf ASHRAE DA-07-045-2007 A Review of Ventilation and Air-Conditioning Technologies for Energy-Efficient Healthy Buildings in the Tropics《节能健康建筑物在热带的通风和空气调节技术审查》.pdf
  • ASHRAE DA-07-046-2007 Monitored Indoor Moisture and Temperature Conditions in Humid-Climate US Residences《在潮湿的气候美国住宅监测室内湿度和温度条件》.pdf ASHRAE DA-07-046-2007 Monitored Indoor Moisture and Temperature Conditions in Humid-Climate US Residences《在潮湿的气候美国住宅监测室内湿度和温度条件》.pdf
  • ASHRAE DA-07-047-2007 Best Practices for Energy-Efficient Data centers Identified through Case Studies and Demonstration Projects《节能数据中心通过个案研究和示范项目鉴定的最佳做法》.pdf ASHRAE DA-07-047-2007 Best Practices for Energy-Efficient Data centers Identified through Case Studies and Demonstration Projects《节能数据中心通过个案研究和示范项目鉴定的最佳做法》.pdf
  • ASHRAE DA-07-048-2007 The impact of Moore's Law on the Total Cost of Computing and How Inefficiencies in the Data Center Increase These Costs《在摩尔定律下总成本的计算影响 数据中心增加这些费用如何效率低下》.pdf ASHRAE DA-07-048-2007 The impact of Moore's Law on the Total Cost of Computing and How Inefficiencies in the Data Center Increase These Costs《在摩尔定律下总成本的计算影响 数据中心增加这些费用如何效率低下》.pdf
  • 相关搜索

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

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