getline,cin,(cin>>x).get();
#include<bits/stdc++.h>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<stdio.h>
#include<cmath>
#define debug cout<<"ok"<<endl
typedef long long ll;
const int maxn=1e4+500;
const int mod=1e9+7;
using namespace std;
string s,buf;
int n;
int main()
{
ios::sync_with_stdio(false);
(cin>>n).get();//cin>>n会忽略掉换行符而getline遇见换行符会停止所以cin不能配getline要用(cin>>n).get();代替
getline(cin,s);
stringstream ss(s);
while(ss>>buf)
{
cout<<buf<<endl;
}
}
来源:CSDN
作者:蛋蛋さん
链接:https://blog.csdn.net/weixin_45697774/article/details/103605463