【计算机类职业资格】国家三级(网络技术)机试-试卷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右半部分的字符串按照升序排列。

展开阅读全文
相关资源
猜你喜欢
  • BS 5743-2000 Tobacco and tobacco products - Atmosphere for conditioning and testing《烟草和烟草产品 调节处理和试验的大气环境》.pdf BS 5743-2000 Tobacco and tobacco products - Atmosphere for conditioning and testing《烟草和烟草产品 调节处理和试验的大气环境》.pdf
  • BS 5752-10-1986 Methods of test for coffee and coffee products - Instant coffee size analysis《咖啡与咖啡制品试验方法 第10部分 速溶咖啡 粒度分析》.pdf BS 5752-10-1986 Methods of test for coffee and coffee products - Instant coffee size analysis《咖啡与咖啡制品试验方法 第10部分 速溶咖啡 粒度分析》.pdf
  • BS 5752-11-1987 Methods of test for coffee and coffee products - Instant coffee determination of free-flow and compacted bulk densities《咖啡与咖啡制品试验方法 第11部分 速溶咖啡 自由流动和压实体密度测定》.pdf BS 5752-11-1987 Methods of test for coffee and coffee products - Instant coffee determination of free-flow and compacted bulk densities《咖啡与咖啡制品试验方法 第11部分 速溶咖啡 自由流动和压实体密度测定》.pdf
  • BS 5752-13-1995 Methods of test for coffee and coffee products - Roasted ground coffee - Determination of moisture content - Karl Fischer method (reference method)《咖啡和咖啡产品的试验方法 第13.pdf BS 5752-13-1995 Methods of test for coffee and coffee products - Roasted ground coffee - Determination of moisture content - Karl Fischer method (reference method)《咖啡和咖啡产品的试验方法 第13.pdf
  • BS 5752-14-1995 Methods of test for coffee and coffee products - Roasted ground coffee - Determination of moisture content (loss in mass at 103 C (routine method)《咖啡和咖啡制品试验方法 烤粗咖啡 .pdf BS 5752-14-1995 Methods of test for coffee and coffee products - Roasted ground coffee - Determination of moisture content (loss in mass at 103 C (routine method)《咖啡和咖啡制品试验方法 烤粗咖啡 .pdf
  • BS 5752-15-1997 Methods of test for coffee and coffee products - Instant coffee determination of free and total carbohydrate contents by high performance anion-exchange chromatogra.pdf BS 5752-15-1997 Methods of test for coffee and coffee products - Instant coffee determination of free and total carbohydrate contents by high performance anion-exchange chromatogra.pdf
  • BS 5752-16-1996 Methods of test for coffee and coffee products - Green and roasted coffee - Determination of free-flow bulk density of whole beans (routine method)《咖啡和咖啡制品试验方法 生咖啡和.pdf BS 5752-16-1996 Methods of test for coffee and coffee products - Green and roasted coffee - Determination of free-flow bulk density of whole beans (routine method)《咖啡和咖啡制品试验方法 生咖啡和.pdf
  • BS 5752-2-1984 Methods of test for coffee and coffee products - Green coffee determination of moisture content (routine method)《咖啡与咖啡制品试验方法 第2部分 生咖啡:水分测定(常规法)》.pdf BS 5752-2-1984 Methods of test for coffee and coffee products - Green coffee determination of moisture content (routine method)《咖啡与咖啡制品试验方法 第2部分 生咖啡:水分测定(常规法)》.pdf
  • BS 5752-3-1983 Methods of test for coffee and coffee products - Coffee determination of caffeine content (reference method)《咖啡与咖啡制品试验方法 第3部分 生咖啡 咖啡碱含量测定(参照法)》.pdf BS 5752-3-1983 Methods of test for coffee and coffee products - Coffee determination of caffeine content (reference method)《咖啡与咖啡制品试验方法 第3部分 生咖啡 咖啡碱含量测定(参照法)》.pdf
  • 相关搜索

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

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