#include"stdio.h"
#include"iostream.h"
#include"dos.h"
#include"graphics.h"
#include"conio.h"
#include"math.h"
void draw()
{
outtextxy(314,98,"12");
outtextxy(384,114,"1");
outtextxy(434,163,"2");
outtextxy(454,230,"3");
outtextxy(317,369,"6");
outtextxy(177,230,"9");
outtextxy(436,300,"4");
outtextxy(195,302,"8");
outtextxy(195,163,"10");
outtextxy(244,112,"11");
outtextxy(388,353,"5");
outtextxy(248,353,"7");
}
void main()
{
int gd=0,gm;
initgraph(&gd,&gm,"c:\\progra~1\\tc\\bgi");
draw();
float s;
float df;
int x_sec,y_sec;
int q_min,w_min;
int a_hour,b_hour;
//int count=0;
struct time t;
while(!kbhit())
{
gettime(&t);
float an_sec=4.72+t.ti_sec*.1047198;
float an_min=4.72+t.ti_min*.1047198;
float an_hour=4.72+t.ti_hour*5*.1047198;
if(t.ti_min>=12 && t.ti_min<24)
{
an_hour=an_hour+2*.1047198;
}
if(t.ti_min>=24 && t.ti_min<36)
{
an_hour=an_hour+(3*.1047198);
}
if(t.ti_min>=36 && t.ti_min<48)
{
an_hour=an_hour+(4*.1047198);
}
if(t.ti_min>=48 && t.ti_min<60)
{
an_hour=an_hour+(5*.1047198);
}
gotoxy(2,2);
printf("The current System time is: %d: %d: %d",t.ti_hour, t.ti_min, t.ti_sec);
cout<<" ";
setlinestyle(0,0,0);
setcolor(0);
line(320,240,x_sec,y_sec);
line(320,240,q_min,w_min);
line(320,240,a_hour,b_hour);
x_sec=320+100*cos(an_sec);
y_sec=240+100*sin(an_sec);
q_min=320+110*cos(an_min);
w_min=240+110*sin(an_min);
a_hour=320+85*cos(an_hour);
b_hour=240+85*sin(an_hour);
setcolor(WHITE);
setlinestyle(0,0,1);
line(320,240,x_sec,y_sec);
setlinestyle(0,0,2);
setcolor(YELLOW);
line(320,240,q_min,w_min);
setlinestyle(0,0,3);
setcolor(YELLOW);
line(320,240,a_hour,b_hour);
an_sec+=.1047198;
delay(1000);
}
getch();
#include"iostream.h"
#include"dos.h"
#include"graphics.h"
#include"conio.h"
#include"math.h"
void draw()
{
outtextxy(314,98,"12");
outtextxy(384,114,"1");
outtextxy(434,163,"2");
outtextxy(454,230,"3");
outtextxy(317,369,"6");
outtextxy(177,230,"9");
outtextxy(436,300,"4");
outtextxy(195,302,"8");
outtextxy(195,163,"10");
outtextxy(244,112,"11");
outtextxy(388,353,"5");
outtextxy(248,353,"7");
}
void main()
{
int gd=0,gm;
initgraph(&gd,&gm,"c:\\progra~1\\tc\\bgi");
draw();
float s;
float df;
int x_sec,y_sec;
int q_min,w_min;
int a_hour,b_hour;
//int count=0;
struct time t;
while(!kbhit())
{
gettime(&t);
float an_sec=4.72+t.ti_sec*.1047198;
float an_min=4.72+t.ti_min*.1047198;
float an_hour=4.72+t.ti_hour*5*.1047198;
if(t.ti_min>=12 && t.ti_min<24)
{
an_hour=an_hour+2*.1047198;
}
if(t.ti_min>=24 && t.ti_min<36)
{
an_hour=an_hour+(3*.1047198);
}
if(t.ti_min>=36 && t.ti_min<48)
{
an_hour=an_hour+(4*.1047198);
}
if(t.ti_min>=48 && t.ti_min<60)
{
an_hour=an_hour+(5*.1047198);
}
gotoxy(2,2);
printf("The current System time is: %d: %d: %d",t.ti_hour, t.ti_min, t.ti_sec);
cout<<" ";
setlinestyle(0,0,0);
setcolor(0);
line(320,240,x_sec,y_sec);
line(320,240,q_min,w_min);
line(320,240,a_hour,b_hour);
x_sec=320+100*cos(an_sec);
y_sec=240+100*sin(an_sec);
q_min=320+110*cos(an_min);
w_min=240+110*sin(an_min);
a_hour=320+85*cos(an_hour);
b_hour=240+85*sin(an_hour);
setcolor(WHITE);
setlinestyle(0,0,1);
line(320,240,x_sec,y_sec);
setlinestyle(0,0,2);
setcolor(YELLOW);
line(320,240,q_min,w_min);
setlinestyle(0,0,3);
setcolor(YELLOW);
line(320,240,a_hour,b_hour);
an_sec+=.1047198;
delay(1000);
}
getch();
}
No comments:
Post a Comment