fork download
  1. #include <iostream>
  2. #include <unordered_set>
  3. #include <string>
  4.  
  5. int main()
  6. {
  7. const std::unordered_set<char> s{
  8. 's',
  9. 'e',
  10. 'x',
  11. };
  12.  
  13.  
  14. const std::string t = "analsex";
  15. for (auto c : t) {
  16. if (s.cend() != s.find(c)) {
  17. std::cout << "maybe sex." << std::endl;
  18. break;
  19. }
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
maybe sex.