#include<string>
using namespace std;
string line ;
while(getline(cin,line)){
cout<<line<<endl;
}
cout<<"getline fail exit"<<endl;
C++获取一行string
最新推荐文章于 2024-04-27 10:10:08 发布
#include<string>
using namespace std;
string line ;
while(getline(cin,line)){
cout<<line<<endl;
}
cout<<"getline fail exit"<<endl;