#include #include #include #include using namespace std; int main() { //Get current time const auto now {chrono::system_clock::now()}; const time_t t {chrono::system_clock::to_time_t(now)}; const tm *const p {localtime(&t)}; //Get the current second (0–59) const int second {p->tm_sec}; //Array of quotes const string quotes[] { "Success is built one step at a time.", "Discipline beats motivation.", "Small progress is still progress.", "Your future self is watching.", "Be stronger than your excuses.", "The only easy day was yesterday.", "It’s a great day to get better.", "Do something today your future self will thank you for." }; //Number of quotes const int nquotes {sizeof(quotes) / sizeof(quotes[0])}; //Pick a quote based on current second const int index {second % nquotes}; cout << "Quote of the moment:\n" << quotes[index] << "\n"; return EXIT_SUCCESS; }