排序

删除

重新赋值

例:

  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));

相关文章:

  • 2021-08-19
  • 2021-07-29
  • 2022-12-23
  • 2022-03-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-04
猜你喜欢
  • 2022-12-23
  • 2021-05-23
  • 2021-10-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
相关资源
相似解决方案