通过代码:
#include <bits/stdc++.h> using namespace std; int n, m; char a[101][101]; const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, -1, 0, 1 }; static struct axis { int x, y; void init() { scanf("%d%d", &x, &y); x ++, y ++; } bool contains(int _x, int _y) { if(_x == x && _y == y) return true; else return false; } } _start, _end; struct QUEUE { int _head, _tail; axis q[101 * 101]; QUEUE() { _head = 1, _tail = 0; } void push_back(int rx,int ry){ _tail ++; q[_tail].x = rx; q[_tail].y = ry; a[rx][ry] = '#'; } void pop_front() { _head ++; } axis front() { return q[_head]; } axis back() { return q[_tail]; } int size() { return _tail -
1215:迷宫
最新推荐文章于 2023-01-24 18:04:40 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)