From 3d6e51a283144aca73abad351afa88f69bcf0f8c Mon Sep 17 00:00:00 2001 From: Victoria Date: Wed, 25 Sep 2024 11:17:14 -0700 Subject: [PATCH] resolving single itemed list, closes #2 --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index f2ddce4..03386ee 100644 --- a/main.cpp +++ b/main.cpp @@ -14,12 +14,12 @@ int main(){ else{ cout << "What is your next favorite?\n"; } - cin >> input; + getline(cin, input); list.push_back(input); }while( input != "done" ); cout << "Your favorite list:\n"; - for(int i = 0; i < list.size(); i++){ + for(int i = 0; i < list.size() - 1; i++){ cout << list.at(i) << endl; }