#include<sstream>
#include<iostream>
#include<string>
using namespace std;
int main()
{
string line, word;
while (getline(cin, line))
{
stringstream ss(line);
cout << ss.str() << endl;
while (ss >> word)
{
cout << word << endl;
}
}
return 0;
}
C++读入整行数据的方法
于 2018-09-30 00:09:33 首次发布