学用rectangle画方形C语言实现

2022-07-15 11:15:16   文档大全网     [ 字体: ] [ 阅读: ]

#文档大全网# 导语】以下是®文档大全网的小编为您整理的《学用rectangle画方形C语言实现》,欢迎阅读!
学用,方形,rectangle,语言,实现
C语言学习 学用rectangle画方形



题目:画图,学用rectangle画方形。

1.程序分析:利用for循环控制100-999个数,每个数分解出个位,十位,百位。 2.程序源代码: #include"graphics.h" main()

{intx0,y0,y1,x1,driver,mode,i; driver=VGA;mode=VGAHI; initgraph(&driver,&mode,""); setbkcolor(YELLOW);

x0=263;y0=263;y1=275;x1=275; for(i=0;i<=18;i++) {

setcolor(1);

rectangle(x0,y0,x1,y1); x0=x0-5; y0=y0-5; x1=x1+5; y1=y1+5; }


settextstyle(DEFAULT_FONT,HORIZ_DIR,2); outtextxy(150,40,"Howbeautifulitis!"); line(130,60,480,60); setcolor(2); circle(269,269,137); }


本文来源:https://www.wddqxz.cn/f99d7e659b6648d7c1c7464b.html

相关推荐