/*题7 运动的小车*/
……
……
#include<graphics.h>
#include<stdio.h>
void main()
{
int i,gdriver=DETECT,gmode,size;
int arw[16]={450,100,425,120,440,120,410,150,490,150,460,120,475,120,450,100};
void*buf;
initgraph(&gdriver,&gmode,"");
setbkcolor(12);
setcolor(14);
setlinestyle(0,0,3);
circle(320,240,200);
circle(220,165,45);
circle(420,165,45);
arc(320,300,180,360,40);
getch();
cleardevice();
setbkcolor(3);
setcolor(4);
rectangle(21,205,39,215);
rectangle(69,205,51,215);
arc(31,212,320,610,3);
arc(62,211,300,600,4);
setcolor(12);
setlinestyle(0,0,3);
ellipse(45,220,0,180,40,25);
setlinestyle(0,0,3);
line(5,220,85,220);
setcolor(14);
circle(15,225,5);
setlinestyle(0,0,3);
circle(75,225,5);
setcolor(15);
circle(15,225,1);
circle(75,225,1);
size=imagesize(3,194,91,231);
buf=malloc(size);
getimage(3,194,91,231,buf);
cleardevice();
for(i=0;i<500;i++)
{
line(0,260,639,260);
line(0,360,639,360);
setlinestyle(3,3,3);
line(0,310,639,310);
setlinestyle(0,0,3);
setcolor(2);
drawpoly(8,arw);
setfillstyle(1,2);
floodfill(450,125,2);
setcolor(6);
line(450,151,450,200);
putimage(45+i,250,buf,COPY_PUT);
delay(6500);
setcolor(12);
settextstyle(1,0,1);
outtextxy(100,180,"P");
setcolor(8);
circle(105,190,10);
setlinestyle(0,0,3);
setcolor(4);
line(98,182,111,197);
setcolor(9);
setlinestyle(0,0,3);
line(105,202,105,250);
setcolor(15);
}
getch();
cleardevice();
setbkcolor(7);
setcolor(1);
settextstyle(0,0,2);
outtextxy(20,70,"I'm ****");
getch();
cleardevice();
setcolor(10);
settextstyle(1,0,4);
outtextxy(220,200,"from class 3");
getch();
cleardevice();
setcolor(6);
settextstyle(3,0,8);
outtextxy(500,380,"ALL");
getch();
cleardevice();
setcolor(4);
settextstyle(4,0,10);
outtextxy(140,170,"Thanks");
getch();
closegraph();
}