利用BFS求任意绘制迷宫的路径(感觉路径保存可以再优化下,害(・∀・)!)
#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
using namespace std;
int n, m;
int begin_x, begin_y, end_x, end_y;
int room[100][100];//最大为100*100的迷宫大小
int dir[4][2] = {
{
0,1},{
0,-1},{
1,0},{
-1,0} };//方向为上左下右
struct node {
int x, y;
vector<node> path