C++中带空格的字符串输入

#include<iostream>
using namespace std;
int main()
{
	string str;
	getline(cin,str);
	
	cout<<str;
	
	
	return 0;
}

利用getline函数

猜你喜欢

转载自blog.csdn.net/weixin_41066584/article/details/89219798
今日推荐