一条编程语句生成的图片

 #include <graphics.h>
#include <math.h>
#include <stdlib.h>
#define PI 3.1415926

void main()
{
int radius,circles,colors,j;
float i;
char ch;
int GraphDriver=DETECT,GraphMode;
initgraph(&GraphDriver,&GraphMode,"");
randomize();
for (;;)
{
cleardevice();
colors=random(15)+1;
setcolor(colors);
/*以上语句为图形初始化及清屏语句*/
/*下面一句即是(呵呵,别说不是一条语句噢) ;) */
radius=random(100);
for (circles=30;circles<=150;circles+=20)
for (i=0;i<=PI*2;i+=PI/8)
circle(sin(i)*circles+300,cos(i)*circles+210,radius);
/*下面是用户按任意键退出及关闭图形模式*/
outtextxy(100,450,"Quit(Yes/No)?");
ch=getche();
if (ch=='y' || ch=='Y')
break;
}
closegraph();
}

你可能感兴趣的:(编程,Random,include,图形,colors)