void output(int x, int y)
{
cout<<x<<endl;
}
int main() {
vector vec;
vec.push_back(1);
vec.push_back(2);
vec.push_back(3);
int test = 0;
cout<<"test:"<<test<<endl;
for_each(vec.begin(), vec.end(), output);
for_each(vec.begin(), vec.end(), [&test](int x){cout<<x<<endl; test+=x;});
cout<<"test:"<<test<<endl;
return 0;
}