#include<stdio.h>
#include<stdlib.h>
#include<math.h> /*double pow(x,y)*/
typedef struct S /*允许状态集合数据类型*/
{
int x; /*商人数*/
int y; /*随从数*/
int boat; /*船位置标志0此岸,1对岸*/
}S;
typedef struct D /*允许决策集合数据类型*/
{
int u; /*渡船上商人数*/
int v; /*渡船上随从数*/
int flag; /*5种渡河状态标志*/
/*(flag=1:u=1,v=1);(flag=2:u=2,v=0);*/
/*(flag=3:u=0,v=2);(flag=4:u=1,v=0);*/
/*(flag=5:u=0,v=1)*/
}D;
typedef struct LNode /*状态链表*/
{
int lx;
int ly;
int lboat;
int lflag;
struct LNode *front;
struct LNode *next;
}LNode,*LinkList;
void main()
{
S s;