nbsp; chess[x+1][y]=twtype;
num--;
}
if(chess[x][y-1]==type){
r=(lqnode *)malloc(sizeof(lqnode));
r->x=x;
r->y=y-1;
q->rear->next=r;
r->next=null;
q->rear=r;
chess[x][y-1]=twtype;
num--;
}
if(chess[x][y+1]==type){
r=(lqnode *)malloc(sizeof(lqnode));
r->x=x;
r->y=y+1;
q->rear->next=r;
r->next=null;
q->rear=r;
chess[x][y+1]=twtype;
num--;
}
if(num==4){
break;再判断一遍,找不到就退出
}
t=t->next;
x=t->x;
y=t->y;
printf("%d,%d\n",x,y);
}
t=q->front->next;//先记录一下这个头
int count=0;
printf("该块有以下元素:\n");
while(q->rear!=q->front){
lqnode *s;
s=q->front->next;
x=s->x;
y=s->y;
//上下左右都找一遍,注意条件,有些在边上,比如【0】【0】这个点x-1是找不到的
if(chess[x+1][y]==0 && x+1>=0 && y>=0){
count++;
&nbs