摘要: sort函数:头文件#include ,默认从小到大,如果降序可写第三方函数进行排序,EXP:sort(array,array+n,cmp)1普通排序,升序 1 #include 2 #include 3 using namespace std; 4 int main() 5 { 6 int a[10]={7,3,4,6,5,1,2,9,8,0}; 7 sort(a,a+10); 8 for(int i=0;i 2 #include 3 using namespace std; 4 bool cmp(int a,int b) 5 { 6 return a>b; 7 } 8 int... 阅读全文