⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 用递归算法和非递归算法实现的简单的“迷宫”程序
💻 CPP
字号:

#include "hello.h"
#include <iostream>
using namespace std;

int main()
{
	Maze M;
	M.PrintPath();       //打印没走前的路径
/////////////////////////

	int m=M.solve(1,1);
	if(m==1)    //求解迷宫
	{
	cout<<endl<<endl<<"The recurve path is following:"<<endl;
	M.PrintPath();       //打印路径
	}
	else
		cout<<"The is no path in the Maze!"<<endl;
		
/////////////////////////
	Maze M1;
	int n=M1.no_recurve(1,1);
	if(n==1)    //求解迷宫
	{
	cout<<endl<<endl<<"The no_recurve path is following:"<<endl;
	M1.PrintPath();       //打印路径
	}
	else
		cout<<"The is no path in the Maze!"<<endl;

	
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -