You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
395 B

#include <bits/stdc++.h>
using namespace std;
int a[11] = {0, 5, 8, 4, 12, 6, 8, 9, 5, 10, 3};
int main() {
sort(a + 1, a + 1 + 10); // 排序
int al = unique(a + 1, a + 1 + 10) - a; // 去重
for (int i = 1; i <= al; i++) cout << "a[" << i << "]=" << a[i] << " "; // 输出
return 0;
}