#include using namespace std; int b[] = {0, 13, 32, 9, 40, 19}; int main() { int n = 5; sort(b + 1, b + n + 1); int tot = unique(b + 1, b + n + 1) - b - 1; cout << tot << endl; for (int i = 1; i <= tot; i++) cout << b[i] << " "; return 0; } /* 输出: 5 9 13 19 32 40 */