20140923 cin.get() getline cin

#include<iostream>
#include<string>

using namespace std;

int main()
{
    string title;
    getline(cin,title);//读取输入队列中的回车,但是丢弃不存储在title中
    //cin>>title;//不读取输入队列中的回车,回车仍然在输入队列中
    char a=cin.get();//读取输入队列中多余的回车
}

posted @ 2014-10-09 15:28  yexuannan  阅读(97)  评论(0编辑  收藏  举报