getline solves the problem of space blocking when cin reads a string

string str;

Use cin>>str; block input when encountering a space;

Solution:

getline (cin, str);

Guess you like

Origin blog.csdn.net/nyist_yangguang/article/details/114763522