码迷,mamicode.com
首页 > 其他好文 > 详细

C 实战练习题目58

时间:2020-07-04 17:14:04      阅读:58      评论:0      收藏:0      [点我收藏+]

标签:习题   targe   dir   color   efault   点击   fan   font   ++   

题目:学用rectangle画方形。(在TC中实现)。

程序分析:无。

程序源代码:

 1 #include "graphics.h"
 2 int main()
 3 {
 4     int x0,y0,y1,x1,driver,mode,i;
 5     driver=VGA;mode=VGAHI;
 6     initgraph(&driver,&mode,"");
 7     setbkcolor(YELLOW);
 8     x0=263;y0=263;y1=275;x1=275;
 9     for(i=0;i<=18;i++)
10     {
11         setcolor(1);
12         rectangle(x0,y0,x1,y1);
13         x0=x0-5;
14         y0=y0-5;
15         x1=x1+5;
16         y1=y1+5;
17     }
18     settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
19     outtextxy(150,40,"How beautiful it is!");
20     line(130,60,480,60);
21     setcolor(2);
22     circle(269,269,137);
23 }

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

点击查看原文,谢谢!

C 实战练习题目58

标签:习题   targe   dir   color   efault   点击   fan   font   ++   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!