使用istringstream对一句话中的各个单词进行操作。需包含头文件#include 1234567 istringstream iss{s};for (string word; iss >> word;) { cout<<word<<endl;} 定义s=”each word is separated by single space”.则输出为 each word is separated by single space 赞微海报分享
近期评论