1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
| #include<graphics.h>
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<dos.h>
void main()
{int driver=DETECT,mode=0,*p,R=100;
float f=0;
initgraph(&driver,&mode,"C:\\TC\\BGI");
int x0=ceil(getmaxx()/2-100);
int y0=ceil(getmaxy()/2-100);
int x=0,y=0;
setcolor(RED);
circle(70,70,60);
setfillstyle(1,BLUE);
floodfill(70,70,RED);
setcolor(GREEN);
circle(70,70,40);
setfillstyle(1,CYAN);
floodfill(70,70,GREEN);
setcolor(BLACK);
circle(70,70,20);
setfillstyle(1,BLACK);
floodfill(70,70,BLACK);
getimage(0,0,141,141,p);
getch();
while (!kbhit())
{
y=ceil(R*sin(f)+y0);
x=ceil(R*cos(f)+x0);
putimage(x,y,p,XOR_PUT);
delay(5);
cleardevice();
f=f+0.01;
}
getch();
closegraph();
} |