c++ 中如何储存一个带空格的字符串?string类好像不行...

2025-02-27 10:05:38
推荐回答(1个)
回答1:

string
str;getline(cin,str);getline函数是遇回车符结束输入,而一般的CIN是遇到空格之类的就结束输入