起点为(1,1),终点为右下角
#include
using namespace std;
int map1[21][21]; //记录地图
bool vis[21][21]; //记录某一个位置是否走过
int xx[] = {-1,1,0,0}; //x方向偏移量,上下
int yy[] = {0,0,-1,1}; //y方向偏移量,左右
int n,m,ans;
// 深度优先搜索
// 到达终点
ans++;
return;
}
for(int i = 0; i < 4; i++){
int nx = x + xx[i];
int ny = y + yy[i];
if(nx < 1 || ny < 1 || nx > n || ny > m)
continue;
vis[nx][ny] = true;
}
}
int main(){
for(int i = 1; i <= n; i++){
for(int j = 1; j <= m; j++){
cin >> map1[i][j];
}
}
cout << 0;
}else{
vis[1][1] = true;
dfs(1,1);
cout << ans << endl;
}
return 0;
}