getline()读入一整行

1 string line;
2 getline(cin, line);

cin不能读入空行,用getline可以读入空行。

posted @ 2018-02-28 14:36  bloglxc  阅读(133)  评论(0编辑  收藏  举报