C 实战练习题目64

题目:利用ellipse and rectangle 画图(在TC中实现)。

程序分析:无。

程序源代码:

 1 #include "stdio.h"
 2 #include "graphics.h"
 3 #include "conio.h"
 4 main()
 5 {
 6     int driver=VGA,mode=VGAHI;
 7     int i,num=15,top=50;
 8     int left=20,right=50;
 9     initgraph(&driver,&mode,"");
10     for(i=0;i<num;i++)
11     {
12         ellipse(250,250,0,360,right,left);
13         ellipse(250,250,0,360,20,top);
14         rectangle(20-2*i,20-2*i,10*(i+2),10*(i+2));
15         right+=5;
16         left+=5;
17         top+=10;
18     }
19     getch();
20 }

感谢你的阅读,请用心感悟!希望可以帮到爱学习的你!!分享也是一种快乐!!!请接力。。。

点击查看原文,谢谢!

原文地址:https://www.cnblogs.com/kangyifan/p/13283521.html