1 条题解

  • 0
    @ 2024-12-24 9:54:26

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    
    int main() {
    	int n, x;
    	set <int> s;
    	set <int> :: iterator it;
    	
    	while (cin >> n) {
    		if (n == 0) break;
    		
    		s.clear();
    		while (n --) {
    			cin >> x;
    			s.insert(x);
    		}
    		
    		cout << s.size() << endl;
    		for (it = s.begin(); it != s.end(); it ++) cout << *it << ' ';
    		cout << endl << endl;
    	}
    
    	return 0;
    }
    
    
    • 1

    信息

    ID
    1045
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者