#include #include #include #include #include void fun(int (*a)[5],int i,int j,int m){ if(i<0||j<0||i>=m||j>=m||a[i][j]!=1) return; a[i][j]=2; fun(a,i-1,j,m); fun(a,i+1,j,m); fun(a,i,j-1,m); fun(a,i,j+1,m);}typedef struct Point{ int x; int y;}Point;typedef struct Data{ Point a[100]; int length;}Data;void EnQueue(Data& data,int i,int j,int (*array)[5],int m){ if(i<0||j<0||i>=m||j>=m||array[i][j]!=1) return; Point temp; temp.x=i; temp.y=j; data.a[data.length]=temp; data.length++; array[i][j]=0;}Point DeQueue(Data& data){ Point temp; temp=data.a[0]; for (int i=0;i