vector<int> sun;
//向sun添加元素
for (int i = 0; i < n; ++i)
{
sun.push_back(primes[i]);
}
sort(sun.begin(), sun.end());
//使用 erase 删除
sun.erase(unique(sun.begin(), sun.end()), sun.end());
earse的功能是删除指定范围内的所有函数
unique将相邻的重复的元素移到最后
vector<int> sun;
//向sun添加元素
for (int i = 0; i < n; ++i)
{
sun.push_back(primes[i]);
}
sort(sun.begin(), sun.end());
//使用 erase 删除
sun.erase(unique(sun.begin(), sun.end()), sun.end());
earse的功能是删除指定范围内的所有函数
unique将相邻的重复的元素移到最后