#include #include #include #include using namespace std; struct month { string name; int games; }; int main () { const month a[] { {"January", 0}, {"February", 0}, {"March", 5}, {"April", 26}, {"May", 29}, {"June", 27}, {"July", 25}, {"August", 27}, {"September", 23}, {"October", 0}, {"November", 0}, {"December", 0} }; const size_t n {size(a)}; //lookig at your version of this it appears this isnt necessary since there wont be a for loop string usermonth; cout << "What month are you interested in (start with an uppercase letter)?\n"; cin >> usermonth; const auto it {find_if(begin(a), end(a), [&usermonth](const month& m) {return m.name == usermonth;})}; for (int i {0}; i < n; ++i) { if (a[i].name == usermonth) { cout << "In " << a[i].name << ", the Yankees play " << a[i].games << " games.\n"; return EXIT_SUCCESS; } } }