一段简单的C图形 (TC 2.0 TC 3.0,windows 集成环境)编译
#include<stdio.h>#include<graphics.h>
#include<stdlib.h>
int main(void)
{
int Driver,mode;
int x,y,sty;
Driver=DETECT;
mode=0;
initgraph(&Driver,&mode,"d:\\tc\\bgi");
x=getmaxx();
y=getmaxy();
randomize();
while(!kbhit())
{
setcolor(random(15)+1);
for(sty=EMPTY_FILL;sty<=USER_FILL;sty++)
{
setfillstyle(sty,random(15)+1);
bar(random(x),random(y),random(x),random(y));
delay(50);
}
cleardevice();
}
return 0;
}
[[italic] 本帖最后由 xianshizhe111 于 2008-1-11 16:58 编辑 [/italic]]