#include #include int main () { time_t t; struct tm * lt; time (&t); lt = localtime (&t); printf ( "现在是:%d/%d/%d %d:%d:%d\n",lt->tm_year+1900, lt->tm_mon+2, lt->tm_mday, lt->tm_hour, lt->tm_min, lt->tm_sec); if(lt->tm_mon+1>0&<->tm_mon+1<5) printf("\n夜深了,该睡了"); return 0; }