今天被二维排列排序折磨了一上午
我试图用泡沫来排序,但我发现我很少对某列进行排序
因此转用qsort ()函数
直接上传代码:
boolcomP1(constvoid*a,const void *b ) (if ) ) ) (int* ) ) ) /按升序对第二列中的元素进行排序; elseif () (int * (a ) )=) (int * (b ) ) ) ) ) /按升序对第一列元素进行排序if () ) ) )0) ) retet }return 1 }qsort(store,count,sizeof(int ) *2,comp1 ); //store维数组名称count行长sizeof(int ) *2总共两列comp1自定义函数