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
| #include<conio.h>
#include<graphics.h>
using namespace std;
main()
{
initwindow (300, 300);
int c,x=150,y=150,n,i,color,R,dR,dColor,red,green,blue;
printf("n="); scanf("%d",&n);
R=150;
dR=150/n;
dColor=255/n;
red=green=255;
blue=0;
for (c=0; c<n; c++)
{
setfillstyle(SOLID_FILL, COLOR(red, green, blue));
circle (x,y,R);
R-=dR;
red-=dColor;
green-=dColor;
blue+=dColor;
}
getch();
closegraph();
} |