};
struct State States [150]; char* routesave[150];
/*function monkeygoto,it makes the monkey goto the other place*/ void monkeygoto(int b,int i) {
int a; a=b; if (a==-1) { }
else if(a==0) { }
else if(a==1) { }
routesave[i]=\States[i+1]=States[i]; States[i+1].monkey=-1;
routesave[i]=\States[i+1]=States[i]; States[i+1].monkey=0;
routesave[i]=\States[i+1]=States[i]; States[i+1].monkey=1;
else
{ }
/*end function monkeyygoto*/
/*function movebox,the monkey move the box to the other place*/ void movebox(int a,int i) {
int B; B=a; if(B==-1) { }
else if(B==0) { }
else if(B==1)
printf(\
}
routesave[i]=\States[i+1]=States[i]; States[i+1].monkey=-1; States[i+1].box=-1;
routesave[i] = \States[i+1]=States[i]; States[i+1].monkey=0; States[i+1].box=0;
}
{ } else { }
printf(\
routesave[i] = \States[i+1]=States[i]; States[i+1].monkey=1; States[i+1].box=1;
/*end function movebox*/
/*function climbonto,the monkey climb onto the box*/ void climbonto(int i) { }
routesave[i]=\States[i+1]=States[i]; States[i+1].monbox=1;
/*function climbdown,monkey climb down from the box*/ void climbdown(int i) {
routesave[i]=\States[i+1]=States[i];
}
States[i+1].monbox=-1;
/*function reach,if the monkey,box,and banana are at the same place,the monkey reach banana*/ void reach(int i) { }
routesave[i]=\
/*output the solution to the problem*/ void showSolution(int i) { int c;
printf (\ for(c=0; c
printf (\
}
printf(\}
/*perform next step*/ void nextStep(int i) {
int c;
int j; if(i>=150) {
printf(\ \\n\
return; }
for (c=0; c
{
if(States[c].monkey==States[i].monkey&&States[c].box==States[i].box&&States[c].banana==States[i].banana&&States[c].monbox==States[i].monbox) {
return;
} }
if(States[i].monbox==1&&States[i].monkey==0&&States[i].banana==0&&States[i].box==0) {
} j=i+1;
if(States[i].monkey==0) {
if(States[i].box==0) {
if(States[i].monbox==-1) {
showSolution(i);
printf(\
getchar();/*to save screen for user,press any key to continue*/ return;