main.cpp
来自「用递归算法和非递归算法实现的简单的“迷宫”程序」· C++ 代码 · 共 34 行
CPP
34 行
#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 + =
减小字号Ctrl + -
显示快捷键?