文件名称:13349.-Extended-Normal-Order-Sort
下载
别用迅雷、360浏览器下载。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
介绍说明--下载内容均来自于网络,请自行研究使用
在标准顺序排序,在这些数字的字符串可能不排序的地方,他们的预期。例如,xyz100之前XYZ2。在一些应用中,如列表文件中,可以使用正常的顺序的排序,其中的数字中的字符串的任何字符串被视为与由数字串给定的数值单个数字。例如,以下是正常的顺序:
XYZ001,XYZ2,XYZ003,XYZ08,XYZ23,XYZ100,XYZQ
我们希望延长正常秩序的排序方式有两种:
小写和大写字母排序是相同的(与上壳体值)。
如果一个加(+)或负( - )符号之前一个数字和不遵循一个数字,它被认为是下列数排序目的的一部分。
所以123+456+7890顷由加号,但A +003分隔的三个数字是一样的A3。
做我们的排序,我们将使用库排序例程,但我们需要提供一个比较常规。写一个比较例程作为输入的打印,非空格ASCII字符(字符(33) - CHR(126)),并返回两个字符串:
-1,如果第一个字符串应该先于第二扩展正常秩序
0,如果两个字符串在扩展正常秩序相同,或
1,如果第一个字符串应遵循第二次在延长的正常秩序。-When sorted in standard order, strings with digits in them may not sort to where they are expected. For instance, xyz100 precedes xyz2. In some applications such as listing files, normal order sort may be used where any string of digits in a character string is treated as a single digit with numerical value given by the digit string. For example, the following are in normal order:
XYZ001, XYZ2, XYZ003, XYZ08, XYZ23, XYZ100, XYZQ
We wish to extend normal order sort in two ways:
Lower case and upper case letters sort the same (with the upper case value).
If a plus (+) or minus (-) sign precedes a digit and does not follow a digit, it is considered part of the following number for sorting purposes.
So 123+456+7890 are three numbers separated by plus signs but A+003 is the same as A3.
To do our sort, we will use a library sort routine but we need to furnish a comparison routine. Write a comparison routine which takes as input two strings of printable
XYZ001,XYZ2,XYZ003,XYZ08,XYZ23,XYZ100,XYZQ
我们希望延长正常秩序的排序方式有两种:
小写和大写字母排序是相同的(与上壳体值)。
如果一个加(+)或负( - )符号之前一个数字和不遵循一个数字,它被认为是下列数排序目的的一部分。
所以123+456+7890顷由加号,但A +003分隔的三个数字是一样的A3。
做我们的排序,我们将使用库排序例程,但我们需要提供一个比较常规。写一个比较例程作为输入的打印,非空格ASCII字符(字符(33) - CHR(126)),并返回两个字符串:
-1,如果第一个字符串应该先于第二扩展正常秩序
0,如果两个字符串在扩展正常秩序相同,或
1,如果第一个字符串应遵循第二次在延长的正常秩序。-When sorted in standard order, strings with digits in them may not sort to where they are expected. For instance, xyz100 precedes xyz2. In some applications such as listing files, normal order sort may be used where any string of digits in a character string is treated as a single digit with numerical value given by the digit string. For example, the following are in normal order:
XYZ001, XYZ2, XYZ003, XYZ08, XYZ23, XYZ100, XYZQ
We wish to extend normal order sort in two ways:
Lower case and upper case letters sort the same (with the upper case value).
If a plus (+) or minus (-) sign precedes a digit and does not follow a digit, it is considered part of the following number for sorting purposes.
So 123+456+7890 are three numbers separated by plus signs but A+003 is the same as A3.
To do our sort, we will use a library sort routine but we need to furnish a comparison routine. Write a comparison routine which takes as input two strings of printable
(系统自动生成,下载前可以参看下载内容)
下载文件列表
13349. Extended Normal Order Sort - 副本.cpp
13349. Extended Normal Order Sort.cpp
13349. Extended Normal Order Sort - 副本 (2).cpp