freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

迷宮問題課程設(shè)計報告(文件)

2025-04-29 23:03 上一頁面

下一頁面
 

【正文】 字符,讀取文件中的內(nèi)容 ifstream open()。139。) { i++。 //讀取文件結(jié)束 m=i。i++) //申請空間 {maze[i]=new int[n+2]。139。039。\n39。} } ()。n) //將自定義迷宮寫入文件{int a,b。 cout 請輸入迷宮的長:。 cout ★請輸入迷宮內(nèi)容(0代表可通,1代表不通):\n。 for(i= 0。i=m。 cout ★是否保存新迷宮?(y/n): 。Y39。 string str。 //創(chuàng)新點三:按玩游戲人的意愿創(chuàng)建存儲迷宮的文件,也可不建立。j=n。 opench。} for(i=0。in+2。 //創(chuàng)新點四:用棧p、q,分別存探索迷宮的過程和存儲路徑 DataType Temp1,Temp2。 (Temp1)。 if(!(().x==().xamp。loop4。 =y。amp。 (Temp1)。 }} //表示成功找到路徑 if(().x==().xamp。}} return 0。 stack t。 temp=new Node。 while(!()) //棧p非空,則轉(zhuǎn)移 {temp=new Node。 //列坐標(biāo)方向 if(row==1) temp=1。 //向左,用4表示 (tempdata)。(39。 switch() //輸出相應(yīng)的方向 {case 0:cout)\n。 case 2:cout向右)\n。 case 4:cout向左)\n。im+2。}}20 LD盡我所能。jn+2。 }}}/* Description: 恢復(fù)路徑函數(shù)*/void Restore(int **maze,int m,int n) //恢復(fù)迷宮{int i,j。 case 3:cout向上)\n。 case 1:cout向下)\n。,39。 } while(!()) //棧非空,繼續(xù)輸出 {data=()。 //向右,用2表示 else if(row==1) temp=3。 //獲取下一個位置 //得到行走方向 row=().xtemp。 (tempdata)。 DataType data。 cout ★★迷宮的路徑為endl。().y==().y)//如果沒有新位置入棧,則返回到上一個位置 {()。 Restore(maze,m,n)。 =n。 //標(biāo)志新位置已到達過 (Temp1)。 y=+move[loop].y。().y==().y)) (Temp2)。 maze[1][1]=1。 =1。 return maze。i++) maze[i][0]=maze[i][n+1]=1。 flush(cout)。039。i=m。 cinstr。y39。 cinchoose。j=n。i++) {maze[i]=new int[n+2]。 n=b。 //輸入迷宮的長和寬 cout 請輸入迷宮的寬:。int**maze。 }int** writeFile (int amp。 i++。 //在屏幕中顯示迷宮 j++。039。 ifstream open1()。 //申請長度等于行數(shù)加2的二維指針(為后面的回復(fù)迷宮打下基礎(chǔ)) for(i= 0。 //得列數(shù) j=0。 } //是‘0’或‘1’字符寬就加1 if(ch==39。039。 cout 文件中的迷宮如下: endl。n) //讀出文件{int **maze。 } cout◆◆◆◆◆◆◆ 謝謝,您已經(jīng)退出迷宮系統(tǒng) ◆◆◆◆◆◆◆endl。 char c。 } if(findpath(maze,m,n)) cout ★ Congratulations! 迷宮路徑探索成功!endl。b39。a39。 cout b直接自行輸入endl。 int flag=0,flag1=0。 cout 歡迎進入迷宮游戲 endl。 cout ——迷宮問題 endl。/* Description: */ void main(){ coutendl。n)。 //輸出路徑void Restore(int **maze,int m,int n)。 else return false。 return Temp。 TempNode=top。 TempNodenext=top。//////////////////////////////////////////////////////////////////////* Name: Author:
點擊復(fù)制文檔內(nèi)容
電大資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1