字符串分隔
时间:2021-08-30 00:33:47
收藏:0
阅读:10
#include <sstream>
int main(){
vector<string> arr;
string s;
getline(cin, s);
stringstream ss(s);
while(getline(ss, s, ‘ ‘)){
arr.push_back(s);
}
for(auto &it:arr){
cout<<it<<" ";
}
return 0;
}
原文:https://www.cnblogs.com/yoshinb/p/15202118.html
评论(0)