📅  最后修改于: 2022-03-11 14:59:00.395000             🧑  作者: Mango
cout << "Enter the number: ";
int number;
cin >> number;
cin.ignore(256, '\n'); // remaining input characters up to the next newline character
// are ignored
cout << "Enter names: ";
string names;
getline(cin, names);