【计算机类职业资格】国家三级(网络技术)机试-试卷54及答案解析.doc

上传人:eastlab115 文档编号:1331092 上传时间:2019-10-17 格式:DOC 页数:2 大小:30.50KB
下载 相关 举报
【计算机类职业资格】国家三级(网络技术)机试-试卷54及答案解析.doc_第1页
第1页 / 共2页
【计算机类职业资格】国家三级(网络技术)机试-试卷54及答案解析.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、国家三级(网络技术)机试-试卷 54 及答案解析(总分:2.00,做题时间:90 分钟)一、程序设计题(总题数:1,分数:2.00)1. (分数:2.00)_国家三级(网络技术)机试-试卷 54 答案解析(总分:2.00,做题时间:90 分钟)一、程序设计题(总题数:1,分数:2.00)1. (分数:2.00)_正确答案:(正确答案: )解析:解析:定义循环变量 i、j、k 和整型变量 len、p。 第一层 for 循环中,循环变量 i 从 0 开始,依次递增直到其值等于 20,实现对 20 行数据的逐行处理。在循环体中,对于 i 行首先调用函数strlen(xxi)求得第 i 行字符串的长度

2、并把其值赋给变量 len,再用 len 除以 2,得到第 i 行字符串长度的一半,赋给变量 p。在第二层 for 循环中,循环变量 j 从 0 开始,依次递过来增直到其值等于(p-1),在第三层 for 循环中,循环变量 k 从 j+1 开始,依次递过来增直到其值等于 p,比较字符 xxijASCII码值与 xxikASCII 码值的大小,如果字符 xxij的 ASCII 码值小于 xxik的 ASCII 码值,则两者进行互换实现对第 i 行字符串左半部分的字符串按降序排列。 用变量 len 的值对 2 求余数,如果余数为 1,则调用函数字符串拷贝函数 strcpy(),把从字符串 xxi+

3、p+1 开始直到字符串 xxi的结尾的子字符拷贝到字符串变量 str 中,再调用字符串连接函数 stmcat()把字符串 xxi的中间字符连接到字符串变量 str 的后面,再调用字符串连接函数 stmcat()把字符串 xxi的左半部分的子字符串连接到变量str 的后面;如果余数不等于 1,则调用字符串拷贝函数 strcpyl(),把从字符串 xxi+p 开始直到字符串 xxi的结尾的子字符拷贝到字符串变量 str 中,再调用字符串连接函数 stmcat()把字符串 xxi的左半部分的子字符串连接到变量 str 的后面,实现字符串 xxi左右部分子字符串的交换。 调用字符串拷贝函数 strcpy(),把字符串变量 str 的值拷贝到字符串 xxi,实现把排序后的结果仍按行重新存入字符串数组 xx 中。

展开阅读全文
相关资源
猜你喜欢
  • DIN CEN TR 15120-2013 Tanks for transport of dangerous goods - Guidance and recommendations for loading transport and unloading German version CEN TR 15120 2013《危险物品运输用槽罐 装载 运输和卸载的.pdf DIN CEN TR 15120-2013 Tanks for transport of dangerous goods - Guidance and recommendations for loading transport and unloading German version CEN TR 15120 2013《危险物品运输用槽罐 装载 运输和卸载的.pdf
  • DIN CEN TR 15350-2013 de 9010 Mechanical vibration - Guideline for the assessment of exposure to hand-transmitted vibration using available information including that provided by m.pdf DIN CEN TR 15350-2013 de 9010 Mechanical vibration - Guideline for the assessment of exposure to hand-transmitted vibration using available information including that provided by m.pdf
  • DIN CEN TR 15371-2013 Safety of toys - Replies to requests for interpretation of EN 71-1 EN 71-2 and EN 71-8 German version CEN TR 15371 2013《玩具安全性 对EN 71-1标准、EN 71-2标准及EN 71-8标准解释.pdf DIN CEN TR 15371-2013 Safety of toys - Replies to requests for interpretation of EN 71-1 EN 71-2 and EN 71-8 German version CEN TR 15371 2013《玩具安全性 对EN 71-1标准、EN 71-2标准及EN 71-8标准解释.pdf
  • DIN CEN TR 15404-2010 Solid recovered fuels - Methods for the determination of ash melting behaviour by using characteristic temperatures German version CEN TR 15404 2010《固体回收燃料 使用.pdf DIN CEN TR 15404-2010 Solid recovered fuels - Methods for the determination of ash melting behaviour by using characteristic temperatures German version CEN TR 15404 2010《固体回收燃料 使用.pdf
  • DIN CEN TR 15449-1-2014 Geographic information - Spatial data infrastructures - Part 1 Reference model German version CEN TR 15449-1 2012《地理信息 空间数据基础 第1部分 参考模型 德文版本CEN TR 15449-1-2.pdf DIN CEN TR 15449-1-2014 Geographic information - Spatial data infrastructures - Part 1 Reference model German version CEN TR 15449-1 2012《地理信息 空间数据基础 第1部分 参考模型 德文版本CEN TR 15449-1-2.pdf
  • DIN CEN TR 15449-2-2014 Geographic information - Spatial data infrastructures - Part 2 Best practices German version CEN TR 15449-2 2012《地理信息 空间数据基础 第2部分 最佳规范 德文版本CEN TR 15449-2-20.pdf DIN CEN TR 15449-2-2014 Geographic information - Spatial data infrastructures - Part 2 Best practices German version CEN TR 15449-2 2012《地理信息 空间数据基础 第2部分 最佳规范 德文版本CEN TR 15449-2-20.pdf
  • DIN CEN TR 15449-3-2014 Geographic information - Spatial data infrastructures - Part 3 Data centric view German version CEN TR 15449-3 2012《地理信息 空间数据基础 第3部分 以数据为中心的视图 德文版本CEN TR 15.pdf DIN CEN TR 15449-3-2014 Geographic information - Spatial data infrastructures - Part 3 Data centric view German version CEN TR 15449-3 2012《地理信息 空间数据基础 第3部分 以数据为中心的视图 德文版本CEN TR 15.pdf
  • DIN CEN TR 15522-2-2012 Oil spill identification - Waterborne petroleum and petroleum products - Part 2 Analytical methodology and interpretation of results based on GC-FID and GC-.pdf DIN CEN TR 15522-2-2012 Oil spill identification - Waterborne petroleum and petroleum products - Part 2 Analytical methodology and interpretation of results based on GC-FID and GC-.pdf
  • DIN CEN TR 15588-2011 Hardware for furniture - Terms for hinges and their components Trilingual version CEN TR 15588 2007《家具五金 铰链及其组件术语 三种语言版本 CEN TR 15588-2007》.pdf DIN CEN TR 15588-2011 Hardware for furniture - Terms for hinges and their components Trilingual version CEN TR 15588 2007《家具五金 铰链及其组件术语 三种语言版本 CEN TR 15588-2007》.pdf
  • 相关搜索

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

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