getline 函数

    #include <bits/stdc++.h>
    #include <string>
    using namespace std;
    string s;
    int main()
    {
        getline(cin,s);
        cout<<s<<endl; 
        /*
        fsw sf
        fsw sf
        */
        cin>>s
        cout<<s<<endl;
        fsw sf
        fsw 
        return 0;
    }
原文地址:https://www.cnblogs.com/tingtin/p/11542396.html