--------------------
int n
scanf("%d",&n)
for (int j=0j<nj++)
{
for(i=0i<185i++)
{
putimage(70+i, 170, buf, COPY_PUT)/*左边球向右运动*/
putimage(500-i, 170, buf, COPY_PUT)/*右边球向左运动*/
}
for(i=0i<185i++)
{
putimage(255-i, 170, buf, COPY_PUT)
putimage(315+i, 170, buf, COPY_PUT)
}
}
#include <stdio.h>#include <graphics.h>
int main()
{
int i,j,gdriver,gmode,size
void *buf
gdriver=DETECT
initgraph(&gdriver,&gmode,"d:\\tc2\\bgi")
setbkcolor(BLUE)
cleardevice()
setcolor(LIGHTRED)
setlinestyle(0,0,1)
setfillstyle(1,10)
circle(31,200,30)
floodfill(31,200,12)
size=imagesize(0,169,62,231)
buf=malloc(size)
getimage(0,169,62,231,buf)
putimage(500,269,buf,COPY_PUT)
putimage(320,170,buf,COPY_PUT)
while(1)
{
for(j=0j<4j++)
for(i=0i<260i++)
{
if(kbhit()) {closegraph()exit(0)}
switch(j)
{
case 0:
putimage(i,170,buf,COPY_PUT)
break
case 1:
putimage(321+i,170,buf,COPY_PUT)
break
case 2:
putimage(581-i,170,buf,COPY_PUT)
break
case 3:
putimage(260-i,170,buf,COPY_PUT)
break
}
}
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)