#include #include #include int main (void) { char buf[1024]; char timestr[256]; time_t t; struct tm *tm; while (fgets(buf, 1024, stdin)) { t = time(NULL); tm = localtime(&t); strftime(timestr, 256, "%b %d %H:%M:%S", tm); printf("%s %s", timestr, buf); fflush(stdout); } return 0; }