超简单的C++去重、排序 2020/09/19 | 博客 | 评论(0) | 阅读(71) 一、去重函数unique 头文件:algorithm,所以别忘了加上一句:#include <algorithm> unique的作用就是"去除"数组中重复的元素 #include <iostream> #include <algorithm> using namespace std; int main() { int a[10] = { 0, 7, 7, 6, 1, 1, 5, 5, 8, 9 }; int n = unique(a, a + 1...