1.DFS解法
#include<bits/stdc++.h>
using namespace std;
const int maxn = 100 + 5;
char mpt[maxn][maxn];
int vis[maxn][maxn];
int dirx[9] = {0, 0, 0, 1, -1, 1, -1, 1, -1};
int diry[9] = {0, 1, -1, 0, 0, 1, -1, -1, 1};
int m, n;
void dfs(int x, int y){
vis[x][y] = 1;
...