#include <iostream>
#include <sstream>
#include <string>
std::string GetNthWord(std::string s, std::size_t n)
{
std::istringstream iss (s);
while(n-- > 0 && (iss >> s));
return s;
}
int main()
{
std::cout << GetNthWord("I hope that you can figure out how this works.", 4) << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3N0cmVhbT4KI2luY2x1ZGUgPHN0cmluZz4KCnN0ZDo6c3RyaW5nIEdldE50aFdvcmQoc3RkOjpzdHJpbmcgcywgc3RkOjpzaXplX3QgbikKewogICAgc3RkOjppc3RyaW5nc3RyZWFtIGlzcyAocyk7CiAgICB3aGlsZShuLS0gPiAwICYmIChpc3MgPj4gcykpOwogICAgcmV0dXJuIHM7Cn0KCmludCBtYWluKCkKewogICAgc3RkOjpjb3V0IDw8IEdldE50aFdvcmQoIkkgaG9wZSB0aGF0IHlvdSBjYW4gZmlndXJlIG91dCBob3cgdGhpcyB3b3Jrcy4iLCA0KSA8PCBzdGQ6OmVuZGw7Cn0=