qixin622

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

int main(void)
{
   /* request auto detection */
   int gdriver = DETECT, gmode, errorcode;
   int midx, midy;
   int radius = 100;

   /* initialize graphics and local variables */
   initgraph(&gdriver, &gmode, "");

   /* read result of initialization */
   errorcode = graphresult();
   if (errorcode != grOk)  /* an error occurred */
   {
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Press any key to halt:");
   getch();
      exit(1); /* terminate with an error code */
   }

   midx = getmaxx() / 2;
   midy = getmaxy() / 2;
   setcolor(getmaxcolor());

   /* draw the circle */
   circle(midx, midy, radius);

   /* clean up */
   getch();
   closegraph();
   return 0;
}

分类:

技术点:

相关文章:

  • 2022-02-03
  • 2022-12-23
  • 2021-12-26
  • 2021-12-18
  • 2021-12-03
  • 2022-02-25
  • 2023-01-19
  • 2021-12-05
猜你喜欢
  • 2022-02-04
  • 2022-01-12
  • 2021-12-04
  • 2021-11-22
  • 2021-12-13
  • 2021-11-17
  • 2021-09-08
相关资源
相似解决方案