#include <algorithm>
#include <iostream>
int main()
{
using namespace std;
int a[] = {1, 2, 3, 4, 5};
auto const f = [&](){ for_each(a, a + (sizeof(a) / sizeof(a[0])), [](int i){ cout << i << endl; }); };
a[0] = 2;
f();
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IG1haW4oKQp7Cgl1c2luZyBuYW1lc3BhY2Ugc3RkOwoJaW50IGFbXSA9IHsxLCAyLCAzLCA0LCA1fTsKCQoJYXV0byBjb25zdCBmID0gWyZdKCl7IGZvcl9lYWNoKGEsIGEgKyAoc2l6ZW9mKGEpIC8gc2l6ZW9mKGFbMF0pKSwgW10oaW50IGkpeyBjb3V0IDw8IGkgPDwgZW5kbDsgfSk7IH07CgkKCWFbMF0gPSAyOwoJCglmKCk7Cn0KCQoJ