#include
#include
int main()
{
time_t t1,t2;
struct tm *ptm;
char timestr[128]={'\0'};
time(&t1);
while(1)
{
time(&t2);
if(difftime(t2,t1)>=1)
{
system("cls");
ptm=localtime(&t2);
strftime(timestr,128,"%H:%M:%S",ptm);
printf("%s\n",timestr);
t1=t2;
}
}
system("PAUSE");
return 0;
}