getline()读入一整行

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

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

原文地址:https://www.cnblogs.com/lxc1910/p/8483503.html