// DataStruTest1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stack>
#include <iostream>
#include<stack>
using namespace std;
struct offsets{
int a;
int b;
char * dir;
};
const offsets moves[8] = {
{-1,0,"北"},{-1,1,"东北"},{0,1,"东"},{1,1,"东南"},{1,0,"南"},{1,-1,"西南"},{0,-1,"西"},{-1,-1,"西北"}};
const int m=5,n=6;
int Maze[m+2][n+2] = { 1,1,1,1,1,1,1,1,
0,0,0,1,1,1,0,1,
1,1,1,0,1,1,0,1,
1,0,0,0,1,0,1,1,
1,1,1,0,0,1,0,1,
1,1,0,1,0,1,0,0,
1,1,1,1,1,1,1,1 };
int mask[m+2][n+2] = {0};
stack<offsets> paths;
bo
C++ 迷宫问题的回溯解法
最新推荐文章于 2023-03-10 14:39:17 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)