#include <graphics.h>#include <conio.h>void Initgr(); //初始化图形界面,全屏。不知道怎么弄小屏求指点!void Fence(); //画围墙void main(){ Initgr(); Fence(); getch();}void Initgr(){ int gd=DETECT,gm=0; registerbgidriver(EGAVGA_driver); initgraph(&gd,&gm,"");}void Fence(){ int i; for(i=50;i<=600;i=i+10) { setcolor(LIGHTCYAN); rectangle(i,50,i+10,60); //上面 rectangle(i,440,i+10,450); //下面 } for(i=50;i<=440;i=i+10) { setcolor(LIGHTCYAN); rectangle(50,i,60,i+10); //左面 rectangle(600,i,610,i+10); //右面 }
}
}