33,010
社区成员
发帖
与我相关
我的任务
分享
struct body
{
int x;
int y;
struct body *next;
};
struct body *head,*rear
void initbody()
{
int k;
p=(struct body *)malloc(sizeof(struct body));
p->x=20; p->y=40;
rear=p; head=p;
bar(head->x+1,head->y+1,head->x+9,head->y+9);
for(k=1;k<initnum;k++)
{
p=(struct body *)malloc(sizeof(struct body));
p->x=rear->x+10; p->y=40;
rear->next=p;
rear=p;
bar(rear->x+1,rear->y+1,rear->x+9,rear->y+9);
}
rear->next=head;
}