#include <iostream>
#include <string>
int main() {
const std::string s = "quick \t\t brown \t fox jumps over the\nlazy dog";
const std::string ws = " \t\r\n";
std::size_t pos = 0;
while (pos != s.size()) {
std::size_t from = s.find_first_not_of(ws, pos);
if (from == std::string::npos) {
break;
}
std::size_t to = s.find_first_of(ws, from+1);
if (to == std::string::npos) {
to = s.size();
}
std::cout << "'";
for (std::size_t i = from ; i != to ; i++) {
std::cout << s[i];
}
std::cout << "'" << std::endl;
pos = to;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKaW50IG1haW4oKSB7Cgljb25zdCBzdGQ6OnN0cmluZyBzID0gInF1aWNrIFx0XHQgYnJvd24gXHQgZm94IGp1bXBzIG92ZXIgdGhlXG5sYXp5IGRvZyI7Cgljb25zdCBzdGQ6OnN0cmluZyB3cyA9ICIgXHRcclxuIjsKCXN0ZDo6c2l6ZV90IHBvcyA9IDA7Cgl3aGlsZSAocG9zICE9IHMuc2l6ZSgpKSB7CgkJc3RkOjpzaXplX3QgZnJvbSA9IHMuZmluZF9maXJzdF9ub3Rfb2Yod3MsIHBvcyk7CgkJaWYgKGZyb20gPT0gc3RkOjpzdHJpbmc6Om5wb3MpIHsKCQkJYnJlYWs7CgkJfQoJCXN0ZDo6c2l6ZV90IHRvID0gcy5maW5kX2ZpcnN0X29mKHdzLCBmcm9tKzEpOwoJCWlmICh0byA9PSBzdGQ6OnN0cmluZzo6bnBvcykgewoJCQl0byA9IHMuc2l6ZSgpOwoJCX0KCQlzdGQ6OmNvdXQgPDwgIiciOwoJCWZvciAoc3RkOjpzaXplX3QgaSA9IGZyb20gOyBpICE9IHRvIDsgaSsrKSB7CgkJCXN0ZDo6Y291dCA8PCBzW2ldOwoJCX0KCQlzdGQ6OmNvdXQgPDwgIiciIDw8IHN0ZDo6ZW5kbDsKCQlwb3MgPSB0bzsKCX0KCXJldHVybiAwOwp9