<分区>
例如我们的输入文件in.txt:
naturalistic 10
coppering 20
artless 30
命令后:sort in.txt
artless 30
coppering 20
naturalistic 10
命令后:sort -n -k 2 in.txt
naturalistic 10
coppering 20
artless 30
我的问题:如何在按列排序时保持行稳定。 我想让整条线保持不变,而它的顺序通常在变化吗? 什么算法或代码片段有用?是关于文件读取还是排序工具?