fork download
  1. #include <sstream>
  2. #include <string>
  3. #include <iostream>
  4. #include <list>
  5. #include <set>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. string wejscie="";
  11. getline(cin, wejscie);
  12.  
  13. list<string> split;
  14. set<string> powt;
  15. stringstream str(wejscie);
  16.  
  17. while(!str.eof()) {
  18. string temp;
  19. str >> temp;
  20. split.push_back(temp);
  21. powt.insert(temp);
  22. }
  23.  
  24. if(powt.size() != split.size())
  25. cout << "Wystapily powtorzenia.\n";
  26. else cout << "Bez potworzen.\n";
  27.  
  28. return 0;
  29. }
Success #stdin #stdout 0s 3280KB
stdin
test_1 test_2
stdout
Bez potworzen.