win-tc下编译一闪过去,看不到结果,代码如下
程序代码:
#include<graphics.h> #include<stdio.h> #include<stdlib.h> #include<dos.h> #include<conio.h> void wall(int x, int y) { int sizx = 9; int sizy = 9; setcolor(15); line(x, y, x + sizx, y); line(x, y + 1, x + sizx - 1, y + 1); line(x, y, x, y + sizy); line(x + 1, y, x + 1, y + sizy -1); setcolor(4); line(x + 1, y + sizy, x + sizx, y + sizy); line(x + 2, y + sizy, x + sizx, y + sizy - 1); line(x + sizx - 1, y + 2, x + sizx - 1, y + sizy - 1); line(x + sizx, y + 1, x + sizx, y + sizy); setfillstyle(1, 12); bar(x + 2, y + 2, x + sizx - 2, y + sizy -2); } void dwall() { int j; for(j = 50; j <= 100; j += 10) { wall(j, 40); wall(j, 451); } for(j = 40; j <= 450; j += 10) { wall(50, j); wall(601, j); } } int main(void) { int gdriver = DETECT, gmode; initgraph(&gdriver, &gmode,""); cleardevice(); dwall(); getch(); return 0; }
[ 本帖最后由 qq4056 于 2015-4-22 22:57 编辑 ]