中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. "); //-->

        博客專欄

        EEPW首頁 > 博客 > C語言繪圖教程例子5-1

        C語言繪圖教程例子5-1

        發(fā)布人:chen3bing 時間:2024-05-15 來源:工程師 發(fā)布文章

        代碼

        #include <graphics.h>
        #include <math.h>
        
        void polygon(x0,y0,a,n,af)
        int x0,y0,a,n;
        	float af;
        {
        	
        	
        		int x,y,i;
        		float dtheta,theta;
        		if(n<3) return;
        		dtheta=6.28318/n;
        		theta=af*0.0174533;
        		moveto(x0,y0);
        		x=x0;
        		y=y0;
        		for(i=1;i<n;i++)
        		{
        			x=x+a*cos(theta);
        			y=y+a*sin(theta);
        			lineto(x,y);
        			theta=theta+dtheta;
        		}
        		lineto(x0,y0);
        	}
        
         int main()
         {
        
        	
        
        	
        	int i,a=80,x=200,y=100;
        	int gdriver=DETECT,gmode;
        	initgraph(&gdriver,&gmode,"c\\tc");
        	cleardevice();
        	setbkcolor(9);
        	setcolor(4);
        	for(i=3;i<=10;i++)
        	polygon(x,y,a,i,0); 
        
        		
        		
         getch();
         
        return 0;
         }

        運行

        1710053115378.jpg

        *博客內容為網友個人發(fā)布,僅代表博主個人觀點,如有侵權請聯系工作人員刪除。



        關鍵詞: C語言繪圖

        技術專區(qū)

        關閉