排序
删除
重新赋值
例:
vector<int> ivec = {-1,2,0,0,-1,2,3};
//sort
sort(ivec.begin(),ivec.end());
//delete
auto it = unique(ivec.begin(),ivec.end());
//resize
ivec.resize(distance(ivec.begin(),it));
时间: 2024-10-12 22:36:31
排序
删除
重新赋值
例:
vector<int> ivec = {-1,2,0,0,-1,2,3};
//sort
sort(ivec.begin(),ivec.end());
//delete
auto it = unique(ivec.begin(),ivec.end());
//resize
ivec.resize(distance(ivec.begin(),it));