摘要:
广搜。看代码~#include <iostream>using namespace std;char s[102][102];void visit(int a,int b){ s[a][b]=0; int i,j; for(i=a-1;i<=a+1;i++) for(j=b-1;j<=b+1;j++) if(s[i][j]==-1) visit(i,j);}int main(){ int i,j,m,n,t; char str[102]; while(cin>>m>>n && (m||n)... 阅读全文