以下代码会跳过第一个getline
提示,但会等待第二个提示。
cout << "Enter a new animal in the form of a question," << endl << "e.g., 'Is it a whale?': " << endl;
getline(cin, first_question);
cout << "\nNow enter a question for which the answer is 'yes' for your new" << endl << "animal, and which does not contradict your previous answers: " << endl;
getline(cin, second_question);