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

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

1、国家三级(网络技术)机试模拟试卷 182及答案与解析 一、程序设计题 1 国家三级(网络技术)机试模拟试卷 182答案与解析 一、程序设计题 1 【正确答案】 【试题解析】 定义字符数组 line80、 word80和字符指针变量 p,循环整型变量 i、 j。 在 for循环语句中,循环变量 i从 0开始,依次递增直到其值等于 maxline,实现对文章每行字符串的如下处理。调用内存分配函数 memset给字符数组 line和word在内存中分配 80个字符空间的大小。使指针变量 p指向字符串 xxi的头,变量 j的初值设为 0。利用 while循环语句,当指针变量 p没有到达 xxi的结尾时

2、一直执行如下的操作:当 *p是字母 时,把 *p赋给字符数组 line,同时字符数组下标 j加 1,字符指针 p加 1,指向下一个字母。直到 *p是单词间的分隔符时,退出第二层 while循环。调用字符串连接函数 strcat()在字符串 line后面添加一个空格,实现用空格分隔各个单词,再把由前面的单词组成的字符串 word连接到当前单词的后面,实现按单词逆序排列。把重新组成的新的字符串利用函数 strcpy拷贝到 word中。调用函数 memset对字符数组 line在内存中重新分配 80个字符空间,并设置其下标从 0开始。当 *p非空且不是字母的情况下,指针 p加 1,指向其 下一个字符。依次循环,直到 xxi的结束。最后把对字符串 xxi的处理结果word拷贝到 xxi中,再进行对文章下一行的处理。

展开阅读全文
相关资源
猜你喜欢
  • ASTM B886-2003(2008) Standard Test Method for Determination of Magnetic Saturation (Ms) of Cemented Carbides《烧结碳化物磁性饱和(MS)测定的标准试验方法》.pdf ASTM B886-2003(2008) Standard Test Method for Determination of Magnetic Saturation (Ms) of Cemented Carbides《烧结碳化物磁性饱和(MS)测定的标准试验方法》.pdf
  • ASTM B886-2012 Standard Test Method for Determination of Magnetic Saturation (Ms) of Cemented Carbides《烧结碳化物磁性饱和(Ms)测定的标准试验方法》.pdf ASTM B886-2012 Standard Test Method for Determination of Magnetic Saturation (Ms) of Cemented Carbides《烧结碳化物磁性饱和(Ms)测定的标准试验方法》.pdf
  • ASTM B887-2003 Standard Test Method for Determination of Coercivity (Hcs) of Cemented Carbides《硬质合金矫顽磁性测定的标准试验方法》.pdf ASTM B887-2003 Standard Test Method for Determination of Coercivity (Hcs) of Cemented Carbides《硬质合金矫顽磁性测定的标准试验方法》.pdf
  • ASTM B887-2003(2008)e1 Standard Test Method for Determination of Coercivity (Hcs) of Cemented Carbides《烧结硬制质合金矫顽力(HCS)测定的标准试验方法》.pdf ASTM B887-2003(2008)e1 Standard Test Method for Determination of Coercivity (Hcs) of Cemented Carbides《烧结硬制质合金矫顽力(HCS)测定的标准试验方法》.pdf
  • ASTM B887-2012 Standard Test Method for Determination of Coercivity (Hcs) of Cemented Carbides《烧结碳化物矫顽磁性(Hcs)测定的标准试验方法》.pdf ASTM B887-2012 Standard Test Method for Determination of Coercivity (Hcs) of Cemented Carbides《烧结碳化物矫顽磁性(Hcs)测定的标准试验方法》.pdf
  • ASTM B888 B888M-2013 Standard Specification for Copper Alloy Strip for Use in Manufacture of Electrical Connectors or Spring Contacts《电连接器或弹簧触点产品用铜合金带材标准规格》.pdf ASTM B888 B888M-2013 Standard Specification for Copper Alloy Strip for Use in Manufacture of Electrical Connectors or Spring Contacts《电连接器或弹簧触点产品用铜合金带材标准规格》.pdf
  • ASTM B888 B888M-2017 Standard Specification for Copper Alloy Strip for Use in Manufacture of Electrical Connectors or Spring Contacts《电连接器或弹簧触点制造用铜合金带材的标准规格》.pdf ASTM B888 B888M-2017 Standard Specification for Copper Alloy Strip for Use in Manufacture of Electrical Connectors or Spring Contacts《电连接器或弹簧触点制造用铜合金带材的标准规格》.pdf
  • ASTM B888-2006 Standard Specification for Copper Alloy Strip for Use in Manufacture of Electrical Connectors or Spring Contacts《电连接器或弹簧触点生产用铜合金带材的标准规范》.pdf ASTM B888-2006 Standard Specification for Copper Alloy Strip for Use in Manufacture of Electrical Connectors or Spring Contacts《电连接器或弹簧触点生产用铜合金带材的标准规范》.pdf
  • ASTM B888-2008 Standard Specification for Copper Alloy Strip for Use in Manufacture of Electrical Connectors or Spring Contacts.pdf ASTM B888-2008 Standard Specification for Copper Alloy Strip for Use in Manufacture of Electrical Connectors or Spring Contacts.pdf
  • 相关搜索

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

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