摘要:
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... 阅读全文
posted @ 2014-02-18 16:54
goodniao_1
阅读(197)
评论(0)
推荐(0)
2014年2月18日