#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <stack>
#include <queue>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <bitset>
#include <list>
#include <sstream>
using namespace std;
#define INT_MAX 1 << 30
typedef long long ll;
int n;
int main(int argc, char const* argv[])
{
string a,b;
while (getline(cin,a)) //读一行数据
{
// int d;
stringstream c(a); //用此行创建一个字符串流
while (c >> b) //读入每个行中字符串
{
cout << b << endl; //输出每个字符串
} //这个while可以实现对整数的输入输出
cout << c.str(); //输出流
// while (c >> d)
// {
// cout << d << endl;
// }
}
return 0;
}
字符串处理之字符串流的创建
最新推荐文章于 2022-07-18 12:22:41 发布
