【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;
}
posted on 2011-06-24 18:27 speedmancs 阅读(486) 评论(0) 收藏 举报
浙公网安备 33010602011771号