#include <vector> class Solution { const vector<vector<int>> direction{{-1,0},{1,0},{0,-1},{0,1}};//定义上下左右四个方向 public: int CurPosArea(vector<vector<int> >& grid,int x,int y) { // 如果索引超出范围,就返回0 if(x<0||y<0||x>=grid.size()||y>=grid[0]...