#include #include #include #include #include using namespace std; int main() { const auto now {chrono::system_clock::now()}; const time_t t {chrono::system_clock::to_time_t(now)}; const tm *const p {localtime(&t)}; const int weekday {p->tm_wday}; const string a[]{ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", }; const size_t n {size(a)}; if (weekday < 0 || weekday >= n) { cerr << "Not a valid response \n"; return EXIT_FAILURE; } if (weekday >= 1 && weekday <=5) { cout << "It's a " << a[weekday] << "! You have class!\n"; } else { cout <<"It's a " << a[weekday] << "! Let's party!\n"; } return EXIT_SUCCESS; }