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