我有2列,我想用bash对它们进行排序.
我使用了命令:
sort -k2 -n
c 9
c 11
c 11
sh 11
c 13
c 15
txt 47
txt 94
txt 345
txt 628
sh 3673
Run Code Online (Sandbox Code Playgroud)
这是结果,但我需要它们像这样排序:
c 9
c 11
c 11
c 13
c 15
sh 11
sh 3673
txt 47
txt 94
txt 345
txt 628
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
#include <stdio.h>
void myPrint (int n) {
printf("%d", n/2);
if(n > 0)
myPrint (n - 1);
printf("%d", n);
}
int main (void) {
int count = 4;
myPrint (count);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
这个简单的打印程序打印2110001234,有人请解释为什么最后打印01234.我不知道为什么每次都加1.