#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
using namespace std;
struct c1{
vector<int> v;
c1(vector<int> val):v(val){}
void modifyV(function<string (int)> functionHandle) {
if(functionHandle) {
for_each(v.begin(), v.end(), [&](int e){cout<<functionHandle(e);});
}
}
};
struct c2{
int record;
c2():record(0){};
string c2func(int val) {
record = max(record, val);
return val%2?"odd ":"mean ";
}
void disp() {
cout<<"\nmax number is "<<record;
}
};
int main() {
vector<int> v{1,2,3,4,5};
c1 t(v);
c2 t2;
t.modifyV([&](int val){return t2.c2func(val);});
t2.disp();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KI2luY2x1ZGUgPHN0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnN0cnVjdCBjMXsKCXZlY3RvcjxpbnQ+IHY7CgljMSh2ZWN0b3I8aW50PiB2YWwpOnYodmFsKXt9CgkKCXZvaWQgbW9kaWZ5VihmdW5jdGlvbjxzdHJpbmcgKGludCk+IGZ1bmN0aW9uSGFuZGxlKSB7CgkJaWYoZnVuY3Rpb25IYW5kbGUpIHsKCQkJZm9yX2VhY2godi5iZWdpbigpLCB2LmVuZCgpLCBbJl0oaW50IGUpe2NvdXQ8PGZ1bmN0aW9uSGFuZGxlKGUpO30pOwoJCX0KCX0KfTsKCnN0cnVjdCBjMnsKCWludCByZWNvcmQ7CgljMigpOnJlY29yZCgwKXt9OwoJc3RyaW5nIGMyZnVuYyhpbnQgdmFsKSB7CgkJcmVjb3JkID0gbWF4KHJlY29yZCwgdmFsKTsKCQlyZXR1cm4gdmFsJTI/Im9kZCAiOiJtZWFuICI7Cgl9Cgl2b2lkIGRpc3AoKSB7CgkJY291dDw8IlxubWF4IG51bWJlciBpcyAiPDxyZWNvcmQ7Cgl9Cn07CgppbnQgbWFpbigpIHsKCXZlY3RvcjxpbnQ+IHZ7MSwyLDMsNCw1fTsKCWMxIHQodik7CgljMiB0MjsKCXQubW9kaWZ5VihbJl0oaW50IHZhbCl7cmV0dXJuIHQyLmMyZnVuYyh2YWwpO30pOwoJdDIuZGlzcCgpOwoJcmV0dXJuIDA7Cn0=