From eedf70520bac9c802e1625af1230a8cee834e9b6 Mon Sep 17 00:00:00 2001 From: jbaeee <144491939+jbaeee@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:25:13 -0700 Subject: [PATCH] added getline and removed done, close #2 --- main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index f2ddce4..a7b3b24 100644 --- a/main.cpp +++ b/main.cpp @@ -14,9 +14,9 @@ int main(){ else{ cout << "What is your next favorite?\n"; } - cin >> input; + getline (cin, input); list.push_back(input); - }while( input != "done" ); + }while( input == "done" ); cout << "Your favorite list:\n"; for(int i = 0; i < list.size(); i++){ @@ -24,4 +24,4 @@ int main(){ } return 0; -} \ No newline at end of file +}