fork download
  1. #include <bits/stdc++.h>
  2. #define ll long long
  3. #define fr first
  4. #define sc second
  5. #define sz(x) (int) x.size()
  6. #define pb push_back
  7. #define all(x) x.begin(), x.end()
  8.  
  9. using namespace std;
  10. string printBin(ll m) { string a = ""; for(int i=63; i>=0; i--) { if(m & (1<<i)) {a += '1';} else {a += '0';} } return a; }
  11.  
  12. int main() {
  13. int t; cin >> t;
  14. cin.ignore();
  15. cin.clear();
  16. while(t--) {
  17. string tot;
  18. getline(cin, tot);
  19. stringstream ss(tot);
  20.  
  21. set<string> st;
  22. string aux;
  23. while(ss >> aux) st.insert(aux);
  24.  
  25. int i = 0;
  26. for(auto ai : st){
  27. if(i > 0) cout << " ";
  28. cout << ai;
  29. i++;
  30. }
  31. cout << endl;
  32. }
  33. }
  34.  
Success #stdin #stdout 0s 544KB
stdin
Standard input is empty
stdout
Standard output is empty