{
if(c=='x')
{
s1.eight[0]=9;
s1.space=0;

}
else
s1.eight[0]=c-'0';

for(i=1;i<9;i++)
{
scanf(" %c",&c);
if(c=='x')
{
s1.eight[i]=9;
s1.space=i;
}

else
s1.eight[i]=c-'0';

}

s1.state=Gethash(s1.eight);
for(int i=0;i<9;i++)

s2.eight[i]=i+1;

s2.space=8;

s2.state=Gethash(s2.eight);

if(ReverseOrder(s1.eight)==1)

{
cout<<"unsolvable"<<endl;
continue;
}
found=false;
TBFS();
if(found) // 搜索成功
{
PrintPath1(father1,move1);
PrintPath2(father2,move2);

}
else
cout<<"unsolvable"<<endl;
cout<<endl;
}
return 0;
}


Prev |
Pg.: 1 2


Back to home | File page

Subscribe | Register | Login | N