TC编程时出现了图形界面错误问题--帮忙解决(画圆程序)
#include "graphics.h"void draw_circle(int x,int y,int xc,int yc,int color)
{
putpixel(x+xc,y+yc,color);
putpixel(x+xc,-y+yc,color);
putpixel(-x+xc,y+yc,color);
putpixel(-x+xc,y+yc,color);
putpixel(y+xc,x+yc,color);
putpixel(-y+xc,x+yc,color);
putpixel(y+xc,-x+yc,color);
putpixel(-y+xc,-x+yc,color);
}
void main()
{
int gdriver=0,gmode;
int x,y,r, color,xc,yc;float d;
x=0;
y=0;
r=200;
xc=200;
yc=200;
color=15;
d=1.25-r;
cleardevice();
initgraph(&gdriver,&gmode,"");
draw_circle(x,y,xc,yc,color);
while(x<y)
{
if(d<0)
{d+=2*x+3;x++;}
else
{d+=2*(x-y)+5;x++;y--;}
draw_circle(x,y,xc,yc,color);
}
getch();
closegraph();
}