跳转至

stringstream

约 9 个字 9 行代码

以空格分割字符串

string s = "hello world hey brother manba out";
stringstream ss(s);
string word;
int cnt = 0;
while(ss >> word){
    cout << word << endl;
    cnt++;
}
cout << cnt << endl;

颜色主题调整

评论区~

有用的话请给我个赞和 star => GitHub stars
快来跟我聊天~