#include <bits/stdc++.h>
using namespace std;
struct point {
int x;
int y;
int step;
};
int n, m, sx, sy, ex, ey;
int flag = 1000000;
char temp;
bool tag = false;
bool is_find = false;
int arr[103][103], v[103][103];
void show_v(void) {
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
if (v[i][j] != -1) {
cout << " " << v[i][j];
} else {
cout << v[i][j];
}
cout << " ";
}
cout << " ";
for (int j = 1; j <= m; j++) {
cout << arr[i][j] << " ";
}
cout << endl;
}
cout << endl;
}
bool bfs(int nx, int ny, int step) {
if (is_find) {
//return true;
}
if (arr[nx][ny] != 1) {
return false;
}
if (v[nx][ny] != -1 && step >= v[nx][ny]) {
return false;
}
v[nx][ny] = step;
show_v();
cin >>
c++迷宫可视化DFS编程项目代码
最新推荐文章于 2025-07-01 12:44:33 发布