circle
C語言
Circle,功 能: 在給定半徑以(x, y)為圓心畫圓,用 法:
函數名: circle
功 能: 在給定半徑以(x, y)為圓心畫圓
用 法: void far circle(int x, int y, int radius);
#include
#include
#include
#include
int main(void)
{
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
int radius = 100;
initgraph(&gdriver, &gmode, "");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
setcolor(getmaxcolor());
circle(midx, midy, radius);
getch();
closegraph();
return 0;
}