#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 hour {p->tm_hour}; if (hour < 6 ) { cout << "Go to bed!\n"; } else if (hour <= 12 ) { cout << "Good morning!\n"; } else if (hour <= 17 ) { cout << "Good afternoon!\n"; } else if (hour <= 20 ) { cout << "Good evening!\n"; } else { cout << "Good night!\n"; } return EXIT_SUCCESS; }