#include <sstream>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
void TestIstringStream(void)
{
string word, line;
getline(cin, line);
istringstream isstream(line);
while (isstream >> word)
{
cout<< word.c_str() << endl;
}
}
输入:
ag dfd kk
输出:
ag
dfd
kk