#include <string>
#include <iostream>
int main() {
std::string str = "c++ php java python c# javascript go";
std::string const delimiters{ " " };
size_t index_start, pos = 0;
while ((index_start = str.find_first_not_of(delimiters, pos)) != std::string::npos) {
pos = str.find_first_of(delimiters, index_start + 1);
std::cout << str.substr(index_start, 1) << "\n";
}
}
/*
run:
c
p
j
p
c
j
g
*/