顶一下,挺好的玩意儿,刚上来就沉了可惜
楼主对图形方面挺有研究,
感觉挺好,
俺可是一窍不痛的,
写了比楼主简单100倍的时钟
#include "stdio.h"
#include "conio.h"
#include "stdlib.h"
typedef struct
{
int hour;
int minute;
int second;
} mytime;
int main()
{
long one,two;
char ch;
mytime atime;
printf("Please input the time now:");
scanf("%d%*c%d%*c%d",&atime.hour,&atime.minute,&atime.second);
while(1)
{
if(atime.hour==24)
atime.hour=0;
if(atime.minute>59)
{
atime.minute%=60;
atime.hour++;
}
if(atime.second>59)
{
atime.second%=60;
atime.minute++;
}
one=clock();
do
{
two=clock();
}while(two-one<18); /*这个数随机器调*/
atime.second++;
if(kbhit())
{
ch=getch();
if(ch=='q')
break;
else
printf("time for now is %02d:%02d:%02d\n",atime.hour,atime.minute,atime.second);
}
}
return 0;
}