文件名称: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