文件名称:ag
介绍说明--下载内容来自于网络,使用问题请自行百度
这个双重循环完成按字母顺序排序的工作。在外层循环中把字符数组cs[i]中的国名字符串拷贝到数组st中,并把下标i赋予P。进入内层循环后,把st与cs[i]以后的各字符串作比较,若有比st小者则把该字符串拷贝到st中,并把其下标赋予p。内循环完成后如p不等于i说明有比cs[i]更小的字符串出现,因此交换cs[i]和st的内容。至此已确定了数组cs的第i号元素的排序值。然后输出该字符串。在外循环全部完成之后即完成全部排序和输出。-The double circle in alphabetical order to complete the work order. In the outer circle of the character array cs [i] in the name of the string copied to the array of st, and the subscr ipt i given P. After entering the inner circle, the st and cs [i] after the string to compare, if slightly smaller than st copy of the string to the st, and given its subscr ipt p. After the completion of internal circulation, such as p does not mean that i stated that there were more than cs [i] string appear smaller, so the exchange of cs [i] and the content of st. This has identified cs array element i of the first sort value. And then output the string. Outer circle that is completed after the completion of all the sorting and output.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
ag.doc
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.