題目:學用rectangle畫方形。(在TC中實現)。html
程序分析:無。學習
程序源代碼:spa
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 }
感謝你的閱讀,請用心感悟!但願能夠幫到愛學習的你!!分享也是一種快樂!!!請接力。。。code
點擊查看原文,謝謝!htm