头文件
#include <sstream>
使用方法-使用istringstream分割string默认以空格作为分隔符
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
string str = "1 2 3 4 5";
istringstream tmp(str);
while (tmp >> str)
{
cout << str << endl;
}
cout << str;
}