prg10_6.cpp
来自「Data Structures with C++附代码」· C++ 代码 · 共 42 行
CPP
42 行
#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 + =
减小字号Ctrl + -
显示快捷键?