The comparison uses lexicographical ordering: first the first two
items are compared, and if they differ this determines the outcome of
the comparison; if they are equal, the next two items are compared,
and so on, until either sequence is exhausted. If all items of
two sequences compare equal, the sequences are considered equal.
如果只需要得到一个值,则不需要对列表进行排序。使用内置的^{} 函数和这样的自定义排序函数
甚至
后面的代码也可以工作,因为sequence objects may be compared to other objects with the same sequence type:
相关问题 更多 >
编程相关推荐