網(wǎng)站制作NEWS
求c語言題目解答(小球滾動)
#include"graphics.h"#include"stdlib.h"
main()
{
inti,gdriver,gmode,size,*buf;
gdriver=DETECT;
initgraph(&gdriver,&gmode,"");
setbkcolor(BLACK);
cleardevice();
setcolor(LIGHTRED);
setlinestyle(0,0,1);
setfillstyle(1,4);
circle(100,200,20);
floodfill(100,200,12);
size=imagesize(79,159,131,231);
buf=malloc(size);
getimage(79,159,131,231,buf);
putimage(530,269,buf,COPY_PUT);
getch();
for(i=0;i<200;i++)
{
putimage(75+i,160,buf,COPY_PUT);
putimage(515-i,160,buf,COPY_PUT);
}
for(i=0;i<200;i++)
{
putimage(270-i,160,buf,COPY_PUT);
putimage(320+i,160,buf,COPY_PUT);
}
getch();
closegraph();
}
多重隨機(jī)標(biāo)簽