#include <iostream>
#include<vector>
#include <algorithm>
#include <iterator>
int main() {
std::vector< int > numbers = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
auto is_odd = [](int x){ return x % 2; };
std::vector<int> odds;
std::copy_if(numbers.begin(), numbers.end(), std::back_inserter(odds), is_odd);
for(auto a : odds)
std::cout << a << ' ';
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZTx2ZWN0b3I+CiNpbmNsdWRlIDxhbGdvcml0aG0+CiNpbmNsdWRlIDxpdGVyYXRvcj4KCmludCBtYWluKCkgewoJc3RkOjp2ZWN0b3I8IGludCA+IG51bWJlcnMgPSB7IDEsIDIsIDMsIDQsIDUsIDYsIDcsIDgsIDkgfTsKCWF1dG8gaXNfb2RkID0gW10oaW50IHgpeyByZXR1cm4geCAlIDI7IH07CgkKCXN0ZDo6dmVjdG9yPGludD4gb2RkczsKCXN0ZDo6Y29weV9pZihudW1iZXJzLmJlZ2luKCksIG51bWJlcnMuZW5kKCksIHN0ZDo6YmFja19pbnNlcnRlcihvZGRzKSwgaXNfb2RkKTsKCglmb3IoYXV0byBhIDogb2RkcykKCQlzdGQ6OmNvdXQgPDwgYSA8PCAnICc7Cn0=