#include <algorithm>
#include <vector>
#include <iterator>
#include <iostream>
int main() {
std::vector<int> values{1, 2, 3, 4, 5, 6};
std::copy_if(values.cbegin(),
values.cend(),
std::ostream_iterator<int>(std::cout, " "),
[](const int val) { return val != 2; });
return 0;
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGl0ZXJhdG9yPgojaW5jbHVkZSA8aW9zdHJlYW0+CgppbnQgbWFpbigpIHsKCXN0ZDo6dmVjdG9yPGludD4gdmFsdWVzezEsIDIsIDMsIDQsIDUsIDZ9OwoJc3RkOjpjb3B5X2lmKHZhbHVlcy5jYmVnaW4oKSwgCgkJdmFsdWVzLmNlbmQoKSwgCgkJc3RkOjpvc3RyZWFtX2l0ZXJhdG9yPGludD4oc3RkOjpjb3V0LCAiICIpLCAKCQlbXShjb25zdCBpbnQgdmFsKSB7IHJldHVybiB2YWwgIT0gMjsgfSk7CgkKCXJldHVybiAwOwp9