/in/foo.cc:3:32: error: 'vector' has not been declared
void search(int i, int j , vector<vector<int>>&flag,vector<vector<char>>&grid){
^~~~~~
/in/foo.cc:3:38: error: expected ',' or '...' before '<' token
void search(int i, int j , vector<vector<int>>&flag,vector<vector<char>>&grid){
^
/in/foo.cc:15:20: error: 'vector' has not been declared
int numIslands(vector<vector<char>>& grid) {
^~~~~~
/in/foo.cc:15:26: error: expected ',' or '...' before '<' token
int numIslands(vector<vector<char>>& grid) {
^
/in/foo.cc: In member function 'void Solution::search(int, int, int)':
/in/foo.cc:4:17: error: 'grid' was not declared in this scope
while(i<grid.size()&&j<grid[i].size()&&i>=0&&j>=0){
^~~~
/in/foo.cc:5:16: error: 'flag' was not declared in this scope
if(flag[i][j]==1||grid[i][j]=='0'){
^~~~
/in/foo.cc:8:9: error: 'flag' was not declared in this scope
flag[i][j]=1;//如果是未标记的陆地,则标记
^~~~
/in/foo.cc: In member function 'int Solution::numIslands(int)':
/in/foo.cc:16:9: error: 'vector' was not declared in this scope
vector<vector<int>>flag;
^~~~~~
/in/foo.cc:16:23: error: expected primary-expression before 'int'
vector<vector<int>>flag;
^~~
/in/foo.cc:17:16: error: expected primary-expression before 'int'
vector<int>x;
^~~
/in/foo.cc:18:16: error: expected primary-expression before 'int'
vector<int>y;
^~~
/in/foo.cc:19:23: error: 'grid' was not declared in this scope
for(int i=0;i<grid.size();i++){//如何给内嵌vector的vector用二维数组方式初始化赋值
^~~~
/in/foo.cc:20:13: error: 'flag' was not declared in this scope
flag.push_back(vector<int>());
^~~~
/in/foo.cc:20:35: error: expected primary-expression before 'int'
flag.push_back(vector<int>());
^~~
/in/foo.cc:23:21: error: 'x' was not declared in this scope
x.push_back(i);
^
/in/foo.cc:24:21: error: 'y' was not declared in this scope
y.push_back(j);
^
/in/foo.cc:30:17: error: 'x' was not declared in this scope
while(i<x.size()){
^
/in/foo.cc:31:16: error: 'flag' was not declared in this scope
if(flag[x[i]][y[i]]==0&&grid[x[i]][y[i]]=='1'){
^~~~
/in/foo.cc:31:27: error: 'y' was not declared in this scope
if(flag[x[i]][y[i]]==0&&grid[x[i]][y[i]]=='1'){
^
/in/foo.cc:31:37: error: 'grid' was not declared in this scope
if(flag[x[i]][y[i]]==0&&grid[x[i]][y[i]]=='1'){
^~~~