牧师与野人渡河问题
编译环境
Dev C++ 5.6.1
windows 10
实验要求
实验代码
#include<cstdio>
#include<queue>
#include<vector>
#include<cstdlib>
#include<cstring>
using namespace std;
int n,c;//人数,船容量
/*
**初始化函数
**初始化人数和船容量
*/
void init0()
{
printf("Please input the number of people (n):____\b\b\b");
scanf("%d",&n);
printf("Please input the number of boats (c):____\b\b\b");
scanf("%d",&c);
}
/*
**状态节点
*/
typedef struct NODE
{
int mushiNum;
int yerenNum;
bool isStartPosition;
int step;
int father;
// NODE();
// NODE(int m,int y,bool i,int s,int f):mushiNum(m),yerenNum(y),isStartPosition(i),step(s),father(f){}
}node;
/*
**为状态节点赋值
*/
void setData(node &a,int m,int y,bool i