vector<int> v; sort(v.begin(),v.end()); v.erase(unique(v.begin(), v.end()), v.end()); 转载于:https://www.cnblogs.com/yuguangyuan/p/7760219.html