[C++] 纯文本查看 复制代码 #include <graphics.h>
int high=600,r=50;
float g=0.3,x=400,y=100,vy=0;
int main()
{
initgraph(800, 600);
setcolor(WHITE);
setfillcolor(WHITE);
while(1)
{
fillellipse(x,y,50,50);
vy=vy+g;
y+=vy;
if((y>=high-r)||(y<=r))
{
vy=-vy;
vy++;
y=high-r;
}
Sleep(10);
cleardevice();
}
getch();
closegraph();
return 0;
}
|