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

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

1、国家三级(网络技术)机试模拟试卷 202及答案与解析 一、程序设计题 1 补充程序;该程序要求实现的功能是;把 S字符串中的所有字符左移一个位置,串中的第一个字符移动到最后。请编写 chg(char*s)函数实现以上功能,最后调用函数 readWriteData()从 IN DAT文件中读取 50组数据,分别得出结果,并把结果输出到 OUT DAT文件中。 例如; s字符串中原有内容为; Mn 123xyZ,调用后结果为; n 1 23xyZM。 注意;部分源程序已经给出。 请勿改动主函数 main()和输出函数 readWriteData()的内容。 试题程序; #include #incl

2、ude #define N 81 void readWriteData() void chg(char*s) main() char aN; printf(“Enter a string; “); gets(a); printf(“The original string is; “); puts(a); chg(a); printf(“The string after modified; “); puts(a); readWriteData(); void readWriteData() int i; char aN; FILE*rf, *wf; rf=fopen(“IN DAT“, “r“)

3、 wf=fopen(“OUT DAT“, “w“); for(i=0; i50; i+) fscanf(rf, “ S“, a); chg(a); fprintf(wf, “ s n“, a); fclose(rf); fclose(wf); 国家三级(网络技术)机试模拟试卷 202答案与解析 一、程序设计题 1 【正确答案】 void chg(char*s) int i, strl; char ch; strl=strlen(s); ch=*s; for(i=0; istrl-1; i+) *(s+i)=*(s+i+1); *(s+str1-1)=ch; 【试题解析】 取 s所指的字符串的长度,将其首字母放入 ch中,循环遍历第 1至倒数第 2个字符,再将后一个字符赋给前一个字符。将保存的第一个字符存入最后一个位置即可。

展开阅读全文
相关资源
猜你喜欢
  • ANSI Z245.30-2008 Equipment Technology and Operations for Wastes and Recyclable Materials Waste Containers Safety Requirements (NW&RA)《废弃物和可回收材料用设备技术和运行的美国国家标准.废弃物容器.安全要求》.pdf ANSI Z245.30-2008 Equipment Technology and Operations for Wastes and Recyclable Materials Waste Containers Safety Requirements (NW&RA)《废弃物和可回收材料用设备技术和运行的美国国家标准.废弃物容器.安全要求》.pdf
  • ANSI Z245.41-2015 Equipment Technology and Operations for Wastes and Recyclable Materials Facilities for the Processing of Commingled Recyclable Materials Safety Requirements (NW&R.pdf ANSI Z245.41-2015 Equipment Technology and Operations for Wastes and Recyclable Materials Facilities for the Processing of Commingled Recyclable Materials Safety Requirements (NW&R.pdf
  • ANSI Z245.42-2012 Waste Transfer Station - Safety Requirements (NW&RA)《废物和可循环使用材料的设备技术和操作.垃圾转运站.安全性要求》.pdf ANSI Z245.42-2012 Waste Transfer Station - Safety Requirements (NW&RA)《废物和可循环使用材料的设备技术和操作.垃圾转运站.安全性要求》.pdf
  • ANSI Z245.5-2013 Equipment Technology and Operations for Wastes and Recyclable Materials - Baling Equipment C Safety Requirements for Installation Maintenance Modification Repair a.pdf ANSI Z245.5-2013 Equipment Technology and Operations for Wastes and Recyclable Materials - Baling Equipment C Safety Requirements for Installation Maintenance Modification Repair a.pdf
  • ANSI Z245.51-2013 Equipment Technology and Operations for Wastes and Recyclable Materials C Baling Equipment C Safety Requirements (NW&RA)《废弃物和可再循环材料用设备技术和操作.打包设备.安全性要求》.pdf ANSI Z245.51-2013 Equipment Technology and Operations for Wastes and Recyclable Materials C Baling Equipment C Safety Requirements (NW&RA)《废弃物和可再循环材料用设备技术和操作.打包设备.安全性要求》.pdf
  • ANSI Z245.60-2008 Equipment Technology and Operations for Wastes and Recyclable Materials Waste Containers Compatibility Dimensions (NW&RA)《废弃物和可回收材料用设备的技术和运行.废弃物容器.兼容尺寸》.pdf ANSI Z245.60-2008 Equipment Technology and Operations for Wastes and Recyclable Materials Waste Containers Compatibility Dimensions (NW&RA)《废弃物和可回收材料用设备的技术和运行.废弃物容器.兼容尺寸》.pdf
  • ANSI Z315.1-2012 Tricycles - Safety Requirements (TIA-Toy)《三轮车安全性要求》.pdf ANSI Z315.1-2012 Tricycles - Safety Requirements (TIA-Toy)《三轮车安全性要求》.pdf
  • ANSI Z356.5-1998 Art and Craft Materials - Paints and Inks《工艺美术材料.涂料和油墨》.pdf ANSI Z356.5-1998 Art and Craft Materials - Paints and Inks《工艺美术材料.涂料和油墨》.pdf
  • ANSI Z4.1-1986 Sanitation - In Places of Employment - Minimum Requirements《工作场所环境卫生的最低要求》.pdf ANSI Z4.1-1986 Sanitation - In Places of Employment - Minimum Requirements《工作场所环境卫生的最低要求》.pdf
  • 相关搜索

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

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