From ab9e0b135e87fa92fa6801c289638b734305767d Mon Sep 17 00:00:00 2001 From: aaronrobinsona Date: Wed, 18 Feb 2026 19:40:21 +0000 Subject: [PATCH] fixes #96: nothing error --- main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index d9884f9..5946394 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include using std::cout; using std::cin; @@ -21,12 +22,20 @@ int main(){ pick = rand() % VALIDATION.size(); cout << "What are you listening to?\n"; getline(cin,input); + if(input == "nothing") + { + return 0; + } transform(input.begin(), input.end(), input.begin(), [](unsigned char c){ return std::tolower(c); }); cout << VALIDATION[pick] << "! Let's listen to more\n"; - do{ + do{ cout << "What's next?\n"; getline(cin,input); + if(input == "nothing") + { + return 0; + } transform(input.begin(), input.end(), input.begin(), [](unsigned char c){ return std::tolower(c); }); pick = rand() % VALIDATION.size(); cout << VALIDATION[pick] << "!\n";