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

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

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

2、化成整型赋给变量 len,用 len 的值除以 2,得到字符串 xxi的长度的一半赋给变量 p;在第二层 for 循环中,变量 j 从 0 开始,依次递增直到其值等于(p-1),在循环体中执行第三层 for 循环,循环变量 k 从 j+1 开始,依次递增直到其值等于 p,对字符串 xxi左半部分的子字符串中的字符 xxij和 xxik按照 ASCII 码值的大小进行比较,如果 xxij的ASCII 码值小于 xxik的 ASCII 码值,则两者进行互换,实现对字符串 xxi左半部分的子字符串按照降序排列。然后,有 if 条件语句判断,len 对 2 的余数是否等于 1,如果等于 1,说明字符串 xxi的长度为奇数,则变量 p 加 1,因为这时字符串的中间字符不参与排序。再对字符串 xxij右半部分的字符串按升序排列。在 for 循环中,变量 j 从 p 开始,依次递增直到其值等于 len-1,在循环体中,执行 for循环中,变量 k 从 j+1 开始,依次递增直到其值等于 len,对字符 xxij和 xxik按其 ASCII 码值的大小进行比较,如果字符 xxij的 ASCII 码值大于 xxik的 ASCII 码值,则两者进行互换,实现字符串 xxi右半部分的字符串按照升序排列。

展开阅读全文
相关资源
猜你喜欢
  • KS M ISO 6271-2-2010 Clear liquids-Estimation of colour by the platinum-cobalt scale-Part 2:Spectrophotometric method《透明液体 用铂钴色标评定色度 第2部分 分光光度法》.pdf KS M ISO 6271-2-2010 Clear liquids-Estimation of colour by the platinum-cobalt scale-Part 2:Spectrophotometric method《透明液体 用铂钴色标评定色度 第2部分 分光光度法》.pdf
  • KS M ISO 6286-2010 Molecular absorption spectrometry-Vocabulary-General-Apparatus《分子吸收光谱法 词汇 总则 仪器》.pdf KS M ISO 6286-2010 Molecular absorption spectrometry-Vocabulary-General-Apparatus《分子吸收光谱法 词汇 总则 仪器》.pdf
  • KS M ISO 6383-2-2010 Plastics-Film and sheeting-Determination of tear resistance-Part 2:Elmendorf method《塑料 薄膜和薄板 耐撕裂性测定 第2部分 埃尔曼多(ELMENDORF)法》.pdf KS M ISO 6383-2-2010 Plastics-Film and sheeting-Determination of tear resistance-Part 2:Elmendorf method《塑料 薄膜和薄板 耐撕裂性测定 第2部分 埃尔曼多(ELMENDORF)法》.pdf
  • KS M ISO 6384-2007 Surface active agents-Technical ethoxylated fatty amines-Methods of analysis.pdf KS M ISO 6384-2007 Surface active agents-Technical ethoxylated fatty amines-Methods of analysis.pdf
  • KS M ISO 6446-2009 Rubber products-Bridge bearings-Specification for rubber materials《橡胶制品 桥承支架 橡胶材料规范》.pdf KS M ISO 6446-2009 Rubber products-Bridge bearings-Specification for rubber materials《橡胶制品 桥承支架 橡胶材料规范》.pdf
  • KS M ISO 6447-2009 Rubber seals-Joint rings used for gas supply pipes and fittings-Specification for material《橡胶密封 供气管和配件用密封环 材料规范》.pdf KS M ISO 6447-2009 Rubber seals-Joint rings used for gas supply pipes and fittings-Specification for material《橡胶密封 供气管和配件用密封环 材料规范》.pdf
  • KS M ISO 6448-2009 Rubber seals-Joint rings used for petroleum product supply pipes and fittings-Specification for material《橡胶密封 提供石油产品管道和配件用密封圈 材料规范》.pdf KS M ISO 6448-2009 Rubber seals-Joint rings used for petroleum product supply pipes and fittings-Specification for material《橡胶密封 提供石油产品管道和配件用密封圈 材料规范》.pdf
  • KS M ISO 6452-2012 Rubber- or plastics-coated fabrics-Determination of fogging characteristics of trim materials in the interior of automobiles《橡胶或塑料涂层织物 汽车内装饰材料雾气凝结特征的测定》.pdf KS M ISO 6452-2012 Rubber- or plastics-coated fabrics-Determination of fogging characteristics of trim materials in the interior of automobiles《橡胶或塑料涂层织物 汽车内装饰材料雾气凝结特征的测定》.pdf
  • KS M ISO 6453-2009 Polymeric materials cellular flexible-Polyvinylchloride foam sheeting-Specification《泡沫柔性聚合材料 聚氯乙烯泡沫 规范》.pdf KS M ISO 6453-2009 Polymeric materials cellular flexible-Polyvinylchloride foam sheeting-Specification《泡沫柔性聚合材料 聚氯乙烯泡沫 规范》.pdf
  • 相关搜索

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

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