[C] 画弧线 →→→→→进入此内容的聊天室

来自 , 2019-09-14, 写在 C, 查看 101 次.
URL http://www.code666.cn/view/2d969e2c
  1. #include <graphics.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <conio.h>
  5.  
  6. int main ( void )
  7. {
  8.         /* request auto detection */
  9.         int gdriver = DETECT, gmode, errorcode;
  10.         int midx, midy;
  11.         int stangle = 45, endangle = 135;
  12.         int radius = 100;
  13.  
  14.         /* initialize graphics and local variables */
  15.         initgraph ( &gdriver, &gmode, "" );
  16.  
  17.         /* read result of initialization */
  18.         errorcode = graphresult();    /* an error occurred */
  19.         if ( errorcode != grOk )
  20.         {
  21.                 printf ( "Graphics error: %s\n", grapherrormsg ( errorcode ) );
  22.                 printf ( "Press any key to halt:" );
  23.                 getch();
  24.  
  25.                 exit ( 1 ); /* terminate with an error code */
  26.         }
  27.  
  28.         midx = getmaxx() / 2;
  29.         midy = getmaxy() / 2;
  30.         setcolor ( getmaxcolor() );
  31.  
  32.         /* draw arc */
  33.         arc ( midx, midy, stangle, endangle, radius );
  34.  
  35.         /* clean up */
  36.         getch();
  37.         closegraph();
  38.         return 0;
  39. }

回复 "画弧线"

这儿你可以回复上面这条便签

captcha