fork(1) download
  1. #include<iostream>
  2. #include<string>
  3.  
  4. bool ContainsMyWords(const std::wstring& input)
  5. {
  6. if (std::wstring::npos != input.find(L"white"))
  7. return true;
  8. if (std::wstring::npos != input.find(L"black"))
  9. return true;
  10. if (std::wstring::npos != input.find(L"green"))
  11. return true;
  12. // ...
  13. return false;
  14. }
  15.  
  16.  
  17. int main() {
  18. std::wstring input1 = L"any text goes here";
  19. std::wstring input2 = L"any text goes here black";
  20.  
  21. std::cout << "input1 " << ContainsMyWords(input1) << std::endl;
  22. std::cout << "input2 " << ContainsMyWords(input2) << std::endl;
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
input1 0
input2 1