#include #include #include #include #include int main (int argc, char ** argv) { time_t timestamp; struct tm * timeinfo; srand(time(NULL)); while (true) { time(×tamp); timeinfo = localtime(×tamp); if ((rand() % 10) == 0) { printf("The time is now for coffee. Coffee time it is.\n"); } else { printf("The time is now: %s", asctime(timeinfo)); } fflush(stdout); sleep(rand() % 12); } return 0; }