Skip to content

Commit

Permalink
Refines input handling, closes ChicoState#2
Browse files Browse the repository at this point in the history
  • Loading branch information
Barbara Grigg committed Sep 25, 2024
1 parent 901a829 commit 9380ec7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ int main(){
else{
cout << "What is your next favorite?\n";
}
cin >> input;
list.push_back(input);
getline(cin, input);
if (input != "done") {
list.push_back(input);
}
}while( input != "done" );

cout << "Your favorite list:\n";
Expand Down

0 comments on commit 9380ec7

Please sign in to comment.