题解 | #Simple Sorting#
Simple Sorting
https://www.nowcoder.com/practice/139761e0b59a405786898b7f2db9423f
#include <iostream> #include <map> #include <vector> using namespace std; int main() { int a; while (cin >> a) { // 注意 while 处理多个 case vector<int>k(1001); for(int i=0;i<a;i++){ int m; cin>>m; k[m]++; } for(int i=1;i<=1000;i++){ if(k[i]>0){ cout<<i<<" "; } } cout<< endl; } } // 64 位输出请用 printf("%lld")