fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <algorithm>
  5.  
  6. int main()
  7. {
  8. std::vector<std::string> stringlist =
  9. { "He","is","very","bad","instead","do","yourself"};
  10. std::string findstr = "bad";
  11.  
  12. auto iter = std::find(std::begin(stringlist), std::end(stringlist), findstr);
  13. bool found = (iter != stringlist.end());
  14. std::cout << found;
  15. return 0;
  16. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
1