C++ 按行输入

string s;
while(getline(cin,s)){
    cout<<s<<endl;
}
原文地址:https://www.cnblogs.com/Kinghao0319/p/14614570.html