#include <iostream>
#include <string>
#include <sstream>
struct A
{
std::string text;
};
std::istream& operator>>(std::istream& is, A& a)
{
return is >> a.text;
}
int f(std::string const &s)
{
A a;
int b;
if (std::istringstream{ s } >> a >> b)
{
return std::stoi(a.text) + b;
}
return 0;
}
int main()
{
std::cout << f("1 2") << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8c3N0cmVhbT4KCnN0cnVjdCBBCnsKICAgIHN0ZDo6c3RyaW5nIHRleHQ7Cn07CgpzdGQ6OmlzdHJlYW0mIG9wZXJhdG9yPj4oc3RkOjppc3RyZWFtJiBpcywgQSYgYSkKewogICAgcmV0dXJuIGlzID4+IGEudGV4dDsKfQoKaW50IGYoc3RkOjpzdHJpbmcgY29uc3QgJnMpCnsKICAgIEEgYTsKICAgIGludCBiOwogICAgaWYgKHN0ZDo6aXN0cmluZ3N0cmVhbXsgcyB9ID4+IGEgPj4gYikKICAgIHsKICAgICAgICByZXR1cm4gc3RkOjpzdG9pKGEudGV4dCkgKyBiOwogICAgfQogICAgcmV0dXJuIDA7Cn0KCmludCBtYWluKCkKewogICAgc3RkOjpjb3V0IDw8IGYoIjEgMiIpIDw8IHN0ZDo6ZW5kbDsKfQ==