标签:io ar for sp on 代码 amp bs har
对于上篇博客的代码改进了一点,能一秒一秒的走动了,吼吼
#include<stdio.h>
#include<time.h>
#include<conio.h>
#include <unistd.h>
void time()
{
struct tm *p;
time_t T;
char t[20];
time(&T);
p= localtime(&T);
sprintf(t,"%4d-%.2d-%.2d %02d:%02d:%02d",p->tm_year +1900,p->tm_mon + 1, p->tm_mday,p->tm_hour,p->tm_min,p->tm_sec);
printf("%s\n",t);
}
int main()
{
int i;
for(i=0;i<=500;i++)
{
time();
sleep(1);
clrscr();
}
return 0;
}
标签:io ar for sp on 代码 amp bs har
原文地址:http://www.cnblogs.com/pengjie/p/4053276.html