c++:vector sort()排序
sort()函数:sort(begin, end, cmp),其中begin为指向待sort()的数组的第一个元素的指针,end为指向待sort()的数组的最后一个元素的下一个位置的指针,cmp参数为排序准则,如果没有的话,默认以非降序排序。实例:#include <iostream>#include <vector>#include<algorithm>using namespace std;bool cmp(int x,int y){
原创
2021-12-16 14:06:05 ·
50706 阅读 ·
7 评论