fork(38) download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. vector<string> v1 = {"A","B","C"};
  9. vector<string> v3 = {"A","C","C"};
  10. vector<string> v2 = {"X","Y","A","B","C","D"};
  11.  
  12. auto res = search(begin(v2), end(v2), begin(v1), end(v1));
  13. auto found = res != end(v2);
  14. cout << boolalpha << found;
  15.  
  16. auto res2 = search(begin(v2), end(v2), begin(v3), end(v3));
  17. auto found2 = res2 != end(v2);
  18. cout << boolalpha << found2;
  19.  
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 3476KB
stdin
Standard input is empty
stdout
truefalse