#include <stdio.h> 
#include <stdlib.h> 
int st[1000];
/* 主程式: 使用回溯方法在陣列走迷宮 */ 
int main() 
{ 
    int maze[7][10] = { /* 迷宮陣列,數字0可走, 1不可走 */ 
                        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
                        1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 
                        1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 
                        1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 
                        1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 
                        1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 
                        1, 1, 1, 1, 1, 1, 1, 1, 1, 1 
                        }; 
    int i,j; 
    int x = 5; /* 迷宮入口座標 */  
    int y = 8; 
    while ( x != 1 || y != 1 ) 
    { /* 主迴圈 */ 
 
 
         } 
    cout<<"\n數字 1: 牆壁\n數字 2: 走過的路徑\n"; 
    cout<<"數字 3: 回溯路徑\n"; 
    system("PAUSE"); 　　　　　　　/* 暫停 */ 
    return 0; 
} 
