#include <iostream>
#include <list>
#include <algorithm>
int main(int argc, char *argv[])
{
std::list<int> list = {0, 1, 2, 3, 4, 5};
list.erase(std::remove_if(list.begin(), list.end(), [](int val){ return val == 2 || val == 3; }), list.end());
std::for_each(list.begin(), list.end(), [](int val){ std::cout << val << std::endl; });
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bGlzdD4KI2luY2x1ZGUgPGFsZ29yaXRobT4KCmludCBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pCnsKICBzdGQ6Omxpc3Q8aW50PiBsaXN0ID0gezAsIDEsIDIsIDMsIDQsIDV9OwogIGxpc3QuZXJhc2Uoc3RkOjpyZW1vdmVfaWYobGlzdC5iZWdpbigpLCBsaXN0LmVuZCgpLCBbXShpbnQgdmFsKXsgcmV0dXJuIHZhbCA9PSAyIHx8IHZhbCA9PSAzOyB9KSwgbGlzdC5lbmQoKSk7CiAgc3RkOjpmb3JfZWFjaChsaXN0LmJlZ2luKCksIGxpc3QuZW5kKCksIFtdKGludCB2YWwpeyBzdGQ6OmNvdXQgPDwgdmFsIDw8IHN0ZDo6ZW5kbDsgfSk7CiAgcmV0dXJuIDA7Cn0=