usEqual(PosTypee1,PosTypee2)蚄{肂?if((e1.x==e2.x)&&(e1.y==e2.y))羀 returnTRUE;螄?returnFALSE;莃}膂莀StatusMarkPath(PosTypee,intmg[SIZE][SIZE],intdi)蒆{蒅?switch(di)膂?{case1://向右蒇 mg[e.y][e.x]=11;芈 break;膄 case2://向下节 mg[e.y][e.x]=12;袈 break;蚆 case3://向左羃 mg[e.y][e.x]=13;莁 break;荿 case4://向上莈 mg[e.y][e.x]=14;螂 break;蒁?}螀?returnOK;袆}螅薁PosTypeFrontPos(PosTypee,intdir)袇{薈?PosTypeE;薄?switch(dir){蚁 case1:E.x=e.x-1;//向左芈 E.y=e.y;肆 break;芃 case2:E.x=e.x;//向上螁 E.y=e.y-1;虿 break;螇 case3:E.x=e.x+1;//向右莆 E.y=e.y;螁 break;聿 case4:E.x=e.x;//向下膅 E.y=e.y+1;肄 break;袁?}蒀?returnE;袇}袃羁StatusPathPrint(stack<SElemType>s,intmg[SIZE][SIZE])薇{莅?SElemTypee,front,tail;蚂?intdi;肀?羈?e=s.top();肇?tail=e;蚅?s.pop();膀?MarkPath(e.seat,mg,1);荿?while(!s.empty())薅?{蒄 front=s.top();芀 s.pop();螀 if(Equal(front.seat,FrontPos(e.seat,e.di)))芇{