人工智能二_野人过河问题_实验3. 下载本文

nodefree = result;

result = result -> nextnode; free(nodefree);

printf(\左岸人数 船上人数及方向 右岸人数\\n\ printf(\第%d轮\\n\

fpl = result -> pl - result -> spt + result -> spr; fpr = result -> pr - result -> spr;

fsl = result -> sl - result -> sst + result -> ssr; fsr = result -> sr - result -> ssr;

printf(\传教士??\\t<-\\t?\\n\ printf(\野 人??\\t<-\\t?\\n\

printf(\传教士??\\t->\\t?\\n\ printf(\野 人??\\t->\\t?\\n\ }

printf(\全体传教士和野人全部到达对岸\ free(result); }

void goon() {

char choice; for(;;) {

printf(\是否继续?(Y/N)\\n\ scanf (\ choice=toupper(choice); if(choice=='Y')break; if(choice=='N')exit(0); } }

四.实验心得