#include"stdio.h"
#include"conio.h"
#include"graphics.h"
#include"dos.h"
#include"math.h"
#define PI 3.141592
void main()
{ struct time t;
struct date d;
float t_h,t_m,t_s;
float end_x,end_y;
char p[50];
int driver=DETECT,mode;
registerbgidriver(EGAVGA_driver);
initgraph(&driver,&mode,"");
while(!kbhit())
{cleardevice();
setcolor(BROWN);
circle(320,240,100);
setcolor(BLUE);
settextstyle(0,0,0);
outtextxy(313,145,"12");
outtextxy(405,233,"3");
outtextxy(316,328,"6");
outtextxy(225,233,"9");
time(&t);
// printf("\n%s",ctime(&t));
gettime(&t);
getdate(&d);
setcolor(GREEN);
settextstyle(3,0,4);
sprintf(p,"%d-%d-%d %d:%d:%d",d.da_year,d.da_mon,d.da_day,t.ti_hour,t.ti_min,t.ti_sec);
outtextxy(130,50,p);
setcolor(BLUE);
t_s=(float)t.ti_sec*(2*PI/60);
t_m=((float)t.ti_min*(2*PI/60)+t_s/60.0);
t_h=((float)t.ti_hour*(2*PI/12)+t_m/12.0);
end_x=320+50*sin(t_h);
end_y=240-50*cos(t_h);
setcolor(RED);
line(320,240,end_x,end_y);
end_x=320+75*sin(t_m);
end_y=240-75*cos(t_m);
setcolor(YELLOW);
line(320,240,end_x,end_y);
end_x=320+95*sin(t_s);
end_y=240-95*cos(t_s);
setcolor(GREEN);
line(320,240,end_x,end_y);
sleep(1);
}
}