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
39
40
41
42
43
44
45
46
47
48
49
50
| #include<graphics.h>
#include<conio.h>
void main()
{
int gdriver=DETECT, gmode;
initgraph(&gdriver,&gmode,"C:/TC/BGI");
setbkcolor(BLUE); //1
setcolor(WHITE); //2
line(0,3*getmaxy()/4,getmaxx(), 3*getmaxy()/4); //3,4,5
setfillstyle(SOLID_FILL,LIGHTCYAN); //6
floodfill(0,0,WHITE); //7
setcolor(RED);
setfillstyle(SOLID_FILL,YELLOW);
fillellipse(getmaxx()*(1.0/2.0),getmaxy()*(1.0/4.0),20,20); //8
int points[]={
0,getmaxy()*(3.0/4.0),
getmaxx()*(1.0/4.0),0,
getmaxx()*(1.0/2.0),getmaxy()*(3.0/4.0),
0,getmaxy()*(3.0/4.0)
};
int points2[]={
getmaxx()*(1.0/2.0),getmaxy()*(3.0/4.0),
getmaxx()*(3.0/4.0),0,
getmaxx(),getmaxy()*(3.0/4.0),
getmaxx()*(1.0/2.0),getmaxy()*(3.0/4.0)
};
setfillstyle(SOLID_FILL,GREEN);
setcolor(WHITE);
fillpoly(4,points); //9
setcolor(WHITE);
drawpoly(4, points2); //10
floodfill(getmaxx()*(3.0/4.0) + 1.0, getmaxy()*(1.0/2.0),WHITE);
setcolor(BLACK);
arc(getmaxx()*(1.0/8.0), getmaxy()*(1.0/8.0),60,120,20); //11
arc(getmaxx()*(1.0/8.0)+20, getmaxy()*(1.0/8.0),60,120,20);
getch();
closegraph();
} |