【C++FAQ】怎么输入一行字符串(可能带空格)

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
using namespace std;


int main()
{
	string str;
	while (getline(cin,str))
	{
		cout << str << endl;
	}
	return 0;
}
原文地址:https://www.cnblogs.com/speedmancs/p/2089285.html