主题:几经辛苦,终于作出圆的图形---大家看看吧
[em10]#define PI 3.1415926
#include"graphics.h"
#include"math.h"
main()
{
int i,x0,y0,x,y,driver,mode;
float a;
driver=CGA;mode=CGAC0;
initgraph(&driver,&mode,"");
setcolor(2);
setbkcolor(GREEN);
x0=100;y0=100;
circle(x0,y0,10);
for(i=0;i<16;i++)
{
a=(2*PI/16)*i;
x=ceil(x0+48*cos(a));
y=ceil(y0+48*sin(a));
setcolor(3);line(x0,y0,x,y);
}
setcolor(2);circle(x0,y0,60);
}
大家给点意见啦
#include"graphics.h"
#include"math.h"
main()
{
int i,x0,y0,x,y,driver,mode;
float a;
driver=CGA;mode=CGAC0;
initgraph(&driver,&mode,"");
setcolor(2);
setbkcolor(GREEN);
x0=100;y0=100;
circle(x0,y0,10);
for(i=0;i<16;i++)
{
a=(2*PI/16)*i;
x=ceil(x0+48*cos(a));
y=ceil(y0+48*sin(a));
setcolor(3);line(x0,y0,x,y);
}
setcolor(2);circle(x0,y0,60);
}
大家给点意见啦