>>617
istringstream と getline を使えば、区切られた文字を順番に取り出せる。
空白文字区切りなら、getline の代わりに >> が使える。

https://maku77.github.io/cpp/string/split.html