#include#include #include using namespace std;bool point1[110][110];bool xf[110][110];bool yf[110][110];int tmp,ans;//int d[4][2]={ {0,-1},{0,1},{1,0},{-1,0}};int dfs(int i,int j){ if(i<0||j<0||i>110||j>110)return 0; if(xf[i][j]&&point1[i+1][j]) { point1[i+1][j]=false; tmp++; dfs(i+1,j); } if(i>=1&&point1[i-1][j]) { if(xf[i-1][j]) { point1[i-1][j]=false; tmp++; dfs(i-1,j); } } if(yf[i][j]&&point1[i][j+1]) { point1[i][j+1]=false; tmp++; dfs(i,j+1); } if(j>=1&&point1[i][j-1]&&yf[i][j-1]) { point1[i][j-1]=false; tmp++; dfs(i,j-1); } return 0;}int main(){ int n,m; int i,j,k; int x,y; while(scanf("%d%d",&n,&m)!=EOF) { if(n==0&&m==0)break; memset(point1,false,sizeof(point1)); memset(xf,false,sizeof(xf)); memset(yf,false,sizeof(yf)); for(i=0; i
XXXXXX欲哭无泪的感觉!!!!!!!!!!!!!!!!!!!!!!!!!!