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

📄 prg10_6.cpp

📁 Data Structures with C++附代码
💻 CPP
字号:
#include <iostream.h>
#pragma hdrstop

#include "maze.h"        // include the maze class

void main (void)
{
    // the file containing the maze parameters
    char filename[32];
    
    cout << "Enter the data file name: ";
    cin >> filename;
    
    // build the maze by reading the file
    Maze  M(filename);
    
    // solve the maze and print the result
    if (M.TraverseMaze(1))
        cout << "\nYou are free!" << endl;
    else
        cout << "No path out of the maze" << endl;
}

/*
<Run #1 of Program 10.6>

Enter the data file name: maze1.dat
7  6  2  1
You are free!

<Run #2 of Program 10.6>

Enter the data file name: maze2.dat
No path out of the maze

<Run #3 of Program 10.6>

Enter the data file name: bigmaze.dat
19  17  16  14  10  9  8  2  1
You are free.
*/

⌨️ 快捷键说明

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