fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <set>
  4. #include <ctime>
  5. #include <string.h>
  6. using namespace std;
  7.  
  8. int main() {
  9. string text;
  10. getline(cin, text);
  11. set<char> see;
  12. set<char> dupl;
  13. for(char s : text){
  14. if(see.find(s) != see.end()){
  15. dupl.insert(s);
  16. }
  17. else{
  18. see.insert(s);
  19. }
  20. }
  21. set<char>::iterator it;
  22. for(it = dupl.begin(); it != dupl.end(); it++){
  23. cout << *it << " ";
  24. }
  25. cout<<endl;
  26. return 0;
  27. }
Success #stdin #stdout 0s 5316KB
stdin
Hello
stdout
l