vector<int> v={1,2,4,3,5.2};

则调用以下语句即可:

sort(v.begin(),v.end());

v.erase(unique(v.begin(),v.end()),v.end());
Logo

云原生社区为您提供最前沿的新闻资讯和知识内容

更多推荐