|
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
//printf ( "\t\007%s", asctime (timeinfo) );
printf ("\033[;34m");
printf ("\t[%4d-%02d-%02d %02d:%02d:%02d]\n",
1900+timeinfo->tm_year,
1+timeinfo->tm_mon,
timeinfo->tm_mday,
timeinfo->tm_hour,
timeinfo->tm_min,
timeinfo->tm_sec);
char colorname[3][20] = {{"RED"}, {"BLUE"}, {"YELLLOW"}};
srand(time(&rawtime)); //时间触发
//textcolor(colorname[rand()%3]);
//printf("\t[textcolor is %s]\n", colorname[rand()%3]);
//颜色码和控制码 我的参考链接 http://wenku.baidu.com/view/a38f77ff910ef12d2af9e70b.html
printf("\t◎输入功能项:");
int a = 0;
scanf("%d",&a);
printf("\033[0m");
system("clear");
return a;
}
|