#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
using std::cout;
using std::endl;
using std::list;
using std::vector;
bool IsEven(int n) { return ((n % 2) == 0); }
int main()
{
list<int> lst{ 1,2,3,4,5,6,7,8,9 };
vector<int> vec(9);
std::remove_copy_if(lst.begin(), lst.end(), vec.begin(), IsEven);
for (vector<int>::iterator p = vec.begin(); p != vec.end(); p++)
cout << *p << ' ';
cout << endl;
return 0;
}
/*
run:
1 3 5 7 9 0 0 0 0
*/