C语言通路寻找,用C语言解决迷宫问题设计与寻找通路问题.pdf
用c語言解決迷宮設計與尋找通路問題
摘 要:本課程設計主要解決設計一個迷宮以及在給出一組入口和出口的情況下,求出一條通路的問題。在課程
設計中,程序設計語言采用VisualC++6.0,數(shù)據(jù)結構采用順序棧存儲結構,程序運行平臺為Windows98/2000/XP。
對于迷宮設計問題,首先假設了用“0”表示此道路可通,“1”表示不可通,即障礙,然后采用了簡單的以時間
產生隨機變量 (0,1變量)和人工輸入0-1變量的方法產生迷宮矩陣。對求解迷宮通路問題,采用“窮舉求解”
的方法和設計一個“先進后出”的棧來存放當前位置路徑,最后得出一條行走迷宮的通路。在程序設計中,采用
了結構化與面向對象兩種解決問題的方法。程序通過調試運行,初步實現(xiàn)了設計目標。
關鍵詞 :程序設計;C++6.0;順序棧存儲結構;窮舉求解
Abstract:Thiscoursedesign main solving design amaze andgiven a set ofinlet and outlet.Inthe courseofdesign.
Programming languageusedVisual C++ 6.0 .Data structureandthe storage structure order stack.Programrunning
platform for Windows98/2000/XP.For amaze designproblem.That firstwith "0"saystheroadcan connect."1"mean
not expert..Isnamely obstacles.Andthenusing simpletotimeproducerandomvariables(0, 1variables) and artificial
0-1variablemethodhasthemazematrix. Solvingtheproblem ofmazepathways.The "poor for solving"themethod
and design a "advanced after a"stack to storethecurrent positionpath.Finally draw awalk the accessofthemaze.In
programming.The structural and object-orientedtwokindsofmethodsto solvetheproblems.Program through the
debug operation.Then realizedthedesign goal.
Keywords:Program design;C++6.0;Storage structureorder stack;Poor for solving.
1
目 錄
第一章 引言 …………………………………………………………………………………………………………………………………………….……..3
1.1 課程設計目的………………………………………………………………………………………………………………………….….……..….3
1.2 課程設計內容 ………………………………………………………………..………………………………………………3
1.3 概要設計 ………………………………………………………………………………………………………………………..…….…………..…3
第二章 程序設計說明 …………………………………………………………………………………………………………………….….………….5
2.1 定義抽象數(shù)據(jù)類型 ……………………………………………………………………………………………………….………………5
2.2定義棧結構體及二維數(shù)組 …………………………………………………………………….……………………….…..….…………5
2.3 主程序模塊 ……………………………………………………………………………………………….……………………..………………6
第三章 詳細設計實現(xiàn) …………………………………………….………………………………………………………………..……….…………..7
3.1 流程圖 ..…………………………………………………………………………………………………………….………………………
總結
以上是生活随笔為你收集整理的C语言通路寻找,用C语言解决迷宫问题设计与寻找通路问题.pdf的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c语言指针实现字符串倒序输出,菜鸟求助-
- 下一篇: c语言编程学生管理系统的代码,C语言学生