Código fuente de Win-tc
# incluir & ltdos.h & gt
# incluir & ltconio.h & gt
# incluir & ltmath. h & gt
# include & ltgraphics.h & gt
#Definición PI 3.1415926
int main()
{ p>
int X=300, Y=250, R=100, RR = 130;
int X_HOUR, _ SECOND
int X_DRAW=0, Y_DRAW=0, R_DRAW = 120;
int NUM = 0;
Tiempo de estructura T;
int gdriver=DETECT,gmode
init gráfico( & g driver & gmode, "C:\Program Files\WINYES\TC 201E\BGI");
setlinestyle(0, 1, 3
setcolor (gris claro) ;
circle(X, Y, RR);
setlinestyle( 0, 1, 1);
for(NUM = 0; NUM & lt12; NUM++)
{
establecer color(11);
X _ DRAW = X+R _ DRAW * cos(NUM * 2 * PI/12) ;
Y _ DRAW = Y+R _ DRAW * sin(NUM * 2 * PI/ 12);
circulo(X_DRAW, Y_DRAW, 5);
setfillstyle(1, 11);
if((NUM%3)==0 )floodfill(X_DRAW, Y_DRAW, 11);
}
Y (!kbhit())
{
gettime(& amp; t);
X _ HORA = X+(R/2)* porque (t . ti _ HORA * 2 * PI/12+t . ti _ min * 2 * PI/(60 * 12)-PI/2);
X _ MINUTO = X+R * cos (t . ti _ min * 2 * PI/60-PI/2)* 3/4;
X _ SEGUNDO = X+R * cos(t . ti _ sec * 2 * PI/60 -PI/2);
y _ HORA = X+(R/2)* sin( t . ti _ HORA * 2 * PI/12+t . ti _ min * 2 * PI/(60 * 12)-PI/2);
Y _ MINUTO = Y+R * sin( t . ti _ min * 2 * PI/60-PI/2)* 3/4;
Y _ SEGUNDO = Y+R * sin(t . ti _ sec * 2 * PI/60- PI/2);
setcolor(amarillo);
línea(X, Y, X_HORA, Y _ HORA);
setcolor(rojo);
línea(X, Y, X_MINUT
E, Y _ MINUTO);
setcolor(azul);
línea(X, Y, X _ segundos, Y _ segundos); (10000);
setcolor(negro);
line(X, Y, X_HOUR, Y _ HOUR
line(X, Y, X_MINUTE); ,Y_MINUTE);
line(X,Y,X_segundos,Y_segundos);
}
getch();
p>closegraph();
Devuelve 0;
}