【计算机类职业资格】国家三级(网络技术)机试-试卷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 EN 12697-43-2014 Bituminous mixtures - Test methods for hot mix asphalt - Part 43 Resistance to fuel German version EN 12697-43 2014《沥青混合物 热混合沥青的试验方法 第43部分 耐燃料性 德文版本EN 12697-43.pdf DIN EN 12697-43-2014 Bituminous mixtures - Test methods for hot mix asphalt - Part 43 Resistance to fuel German version EN 12697-43 2014《沥青混合物 热混合沥青的试验方法 第43部分 耐燃料性 德文版本EN 12697-43.pdf
  • DIN EN 12697-44-2010 Bituminous mixtures - Test methods for hot mix asphalt - Part 44 Crack propagation by semi-circular bending test German version EN 12697-44 2010《沥青混合物 热混沥青试验方法.pdf DIN EN 12697-44-2010 Bituminous mixtures - Test methods for hot mix asphalt - Part 44 Crack propagation by semi-circular bending test German version EN 12697-44 2010《沥青混合物 热混沥青试验方法.pdf
  • DIN EN 12697-45-2012 Bituminous mixtures - Test methods for hot mix asphalt - Part 45 Saturation Ageing Tensile Stiffness (SATS) conditioning test German version EN 12697-45 2012《沥.pdf DIN EN 12697-45-2012 Bituminous mixtures - Test methods for hot mix asphalt - Part 45 Saturation Ageing Tensile Stiffness (SATS) conditioning test German version EN 12697-45 2012《沥.pdf
  • DIN EN 12697-46-2012 Bituminous mixtures - Test methods for hot mix asphalt - Part 46 Low temperature cracking and properties by uniaxial tension tests German version EN 12697-46 2.pdf DIN EN 12697-46-2012 Bituminous mixtures - Test methods for hot mix asphalt - Part 46 Low temperature cracking and properties by uniaxial tension tests German version EN 12697-46 2.pdf
  • DIN EN 12697-47-2010 Bituminous mixtures - Test methods for hot mix asphalt - Part 47 Determination of the ash content of natural asphalts German version EN 12697-47 2010《沥青混合物 热混沥.pdf DIN EN 12697-47-2010 Bituminous mixtures - Test methods for hot mix asphalt - Part 47 Determination of the ash content of natural asphalts German version EN 12697-47 2010《沥青混合物 热混沥.pdf
  • DIN EN 12697-49-2014 Bituminous mixtures - Test methods for hot mix asphalt - Part 49 Determination of friction after polishing German version EN 12697-49 2014《沥青混合物 热混沥青的试验方法 第49部.pdf DIN EN 12697-49-2014 Bituminous mixtures - Test methods for hot mix asphalt - Part 49 Determination of friction after polishing German version EN 12697-49 2014《沥青混合物 热混沥青的试验方法 第49部.pdf
  • DIN EN 12697-5-2010 en 5788 Bituminous mixtures - Test methods for hot mix asphalt - Part 5 Determination of the maximum density German version EN 12697-5 2009《沥青混合物 热混合沥青试验方法 第5部分.pdf DIN EN 12697-5-2010 en 5788 Bituminous mixtures - Test methods for hot mix asphalt - Part 5 Determination of the maximum density German version EN 12697-5 2009《沥青混合物 热混合沥青试验方法 第5部分.pdf
  • DIN EN 12697-6-2012 Bituminous mixtures - Test methods for hot mix asphalt - Part 6 Determination of bulk density of bituminous specimens German version EN 12697-6 2012《沥青混合物 热搅沥青的.pdf DIN EN 12697-6-2012 Bituminous mixtures - Test methods for hot mix asphalt - Part 6 Determination of bulk density of bituminous specimens German version EN 12697-6 2012《沥青混合物 热搅沥青的.pdf
  • DIN EN 12697-7-2015 Bituminous mixtures - Test methods for hot mix asphalt - Part 7 Determination of bulk density of bituminous specimens by gamma rays German version EN 12697-7 20.pdf DIN EN 12697-7-2015 Bituminous mixtures - Test methods for hot mix asphalt - Part 7 Determination of bulk density of bituminous specimens by gamma rays German version EN 12697-7 20.pdf
  • 相关搜索

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

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