vc++6.0 求助一个时钟程序?
用C语言编写的一个时钟程序!感谢
程序代码:#include <stdio.h>
#include <time.h>
#include <windows.h>
#include <stdlib.h>
int main()
{
while(true)
{
time_t t = time(NULL);
tm temp,*p;
p = localtime(&t);
temp = *p;
//printf(""localtime(&t);
system("cls");
printf("%d-%d:%d:%d:%d",temp.tm_mon+1,temp.tm_mday,temp.tm_hour,temp.tm_min,temp.tm_sec);
//明明是五月份 不知道为何给我返回个4 秒竟然没有......
Sleep(1000);//停止一分钟
}
return 0;
}









