求任意两个数字之和的c语言程序

2021-11-19 社会 120阅读
20 void MP_Ellipse(int xc , int yc , int a, int b)
21 { 
22     double sqa = a * a;
23     double sqb = b * b;
24 
25     double d = sqb + sqa * (-b + 0.25);
26     int x = 0;
27     int y = b;
28     EllipsePlot(xc, yc, x, y);
29     while( sqb * (x + 1) < sqa * (y - 0.5))
30     {    
31         if (d < 0)
32         {
33             d += sqb * (2 * x + 3);
34         }
35         else 
36         { 
37             d += (sqb * (2 * x + 3) + sqa * (-2 * y + 2));
38             y--;   
39         }
40         x++; 
41         EllipsePlot(xc, yc, x, y);
42     }
43     d = (b * (x + 0.5)) * 2 + (a * (y - 1)) * 2 - (a * b) * 2;
44     while(y > 0)
45     { 
46         if (d < 0)
47         {
48             d += sqb * (2 * x + 2) + sqa * (-2 * y + 3);
49             x++; 
50         }
51         else 
52         {
53             d += sqa * (-2 * y + 3); 
54         }
55         y--;
56         EllipsePlot(xc, yc, x, y);
57     }
58 }
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com