fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. vector<int> a={7,4,15,-3,4,10,17,28,101};
  9. vector<int> b={7,-1,-3,16,23,27,28,45,10,-2,0,1,45,48,49,50};
  10. vector<int> c;
  11.  
  12. copy_if(a.begin(), a.end(), back_inserter(c),
  13. [&](const auto& v) {
  14. return (v&1) && find(b.begin(), b.end(), v)==b.end();
  15. }
  16. );
  17.  
  18. for(const auto& v : c) cout << v << endl;
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 4392KB
stdin
Standard input is empty
stdout
15
17
101