#include <iostream>
using namespace std;
auto makeAdd(int x) {
return [x](int i) { return x + i; };
}
int main() {
int i = 7; // or from cin
auto add = makeAdd(i);
int result = add(888);
cout << "add(888) = " << result;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKYXV0byBtYWtlQWRkKGludCB4KSB7CglyZXR1cm4gW3hdKGludCBpKSB7IHJldHVybiB4ICsgaTsgfTsKfQoKaW50IG1haW4oKSB7CglpbnQgaSA9IDc7IC8vIG9yIGZyb20gY2luCglhdXRvIGFkZCA9IG1ha2VBZGQoaSk7CglpbnQgcmVzdWx0ID0gYWRkKDg4OCk7Cgljb3V0IDw8ICJhZGQoODg4KSA9ICIgPDwgcmVzdWx0OwoJcmV0dXJuIDA7Cn0=