xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 3.93MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-10-29
  • 語言: 其他
  • 標簽: 管理系統??景區??

資源簡介

開發景區管理系統,對景區進行管理。使用圖的數據結構來保存景區景點信息,為用戶提供 創建圖、查詢景點信息、景點導航、搜索最短路徑、鋪設電路規劃等功能(共三次實驗)。 景點數據:景點信息(附件中的Vex.txt)、道路信息(附件中的Edge.txt)

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?“Stack.h“
#include?“Graph.h“
//using?namespace?std;

void?cleanStr(char?string[]);

Graph::Graph()?{
int?i?j;
for?(i?=?0;?i? for?(j?=?0;?j? m_aAdjMatrix[i][j]?=?-1;
}
}
m_nVexNum?=?0;
}


//初始化圖
bool?Graph::InitGraph(char?VexFileName[]?char?EdgeFileName[])?{
ifstream?vexFile(VexFileName);
ifstream?edgeFile(EdgeFileName);
char?string[256]?=?{?0?};
Vex??tempVex;
Edge?tempEdge;
int?vexNum?=?0;

if?(!vexFile.is_open()?||?!edgeFile.is_open())?{
return?false; //文件打開失敗
}

cleanGraph(); //建圖前清零,以免重復創建時出錯
vexFile.getline(string?256);
vexNum?=?str2int(string);
for?(int?i?=?0;?i? cleanStr(string);
vexFile.getline(string?256);
tempVex.num?=?str2int(string);
vexFile.getline(tempVex.name?20);
vexFile.getline(tempVex.desc?1024);
if?(!InsertVex(tempVex))?return?false; //頂點插入失敗
}

cleanStr(string);
while?(!edgeFile.eof())?{
edgeFile?>>?tempEdge.vex1?>>?tempEdge.vex2?>>?tempEdge.weight;
if(!InsertEdge(tempEdge))?return?false; //插入邊失敗
}

vexFile.close();
edgeFile.close();
return?true;
}


//插入頂點
bool?Graph::InsertVex(Vex?sVex)?{
if?(m_nVexNum? m_aVexs[m_nVexNum++]?=?sVex; //插入頂點到數組中
return?true;
}
else?{
return?false; //頂點已滿
}
}


//插入邊
bool?Graph::InsertEdge(Edge?sedge)?{
if?(sedge.vex1?=?20?||?sedge.vex2?=?20)?{
return?false; //頂點的編號越界了
}
else?{
m_aAdjMatrix[sedge.vex1][sedge.vex2]?=?sedge.weight;
m_aAdjMatrix[sedge.vex2][sedge.vex1]?=?sedge.weight;
return?true;
}
}


//獲取頂點
Vex?Graph::GetVex(int?nVex)?{
return?m_aVexs[nVex];
}


//找與指定頂點相連的邊
bool?Graph::FindEdge(int?nVex?int?aEdge[])?{
int?i;
if?(nVex?>?-1?&&?nVex? for?(i?=?0;?i? aEdge[i]?=?m_aAdjMatrix[nVex][i];
}
return?true;
}
else?{
return?false; //頂點編號不對
}
}

//獲取頂點數
int?Graph::GetVexNum(void)?{
return?m_nVexNum;
}

//將圖清零
void?Graph::cleanGraph(void)?{
int?i?j;
for?(i?=?0;?i? for?(j?=?0;?j? m_aAdjMatrix[i][j]?=?-1;
}
}
m_nVexNum?=?0;
}

struct?De?{
int?vex;
int?i;
De()?{?vex?=?-1;?i?=?0;?}
};
//獲取所有路徑,用鏈表返回
Path?*Graph::DFSAll(int?v)?{
bool?isVisited[20]?=?{?false?}flag=true;
Path?*pathList=new?Path;
Path?*tempPath?=?NULL*pTail=pathList;
int?i?n=0;
Stack?stack;
De?tempDe;

if?(v?=?m_nVexNum)?return?NULL; //輸入的頂點超過邊界

tempDe.vex?=?v;
tempDe.i?=?0;
tempPath?=?new?Path;
tempPath->vexs[n++]?=?v;
tempPath->next?=?NULL;
isVisited[v]?=?true;
while(true)?{
for?(i?=?tempDe.i;?i? if?(m_aAdjMatrix[tempDe.vex][i]?>?0?&&?!isVisited[i])?{
isVisited[i]?=?true;
tempDe.i?=?i+1;
stack.push(tempDe);
tempDe.vex?=?i;
tempPath->vexs[n++]?=?i;
i?=?-1; //f

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????3922??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\cl.command.1.tlog

?????文件??????57524??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\CL.read.1.tlog

?????文件???????4220??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\CL.write.1.tlog

?????文件?????????91??2017-04-28?15:12??實驗2-4\GraphCPro\Debug\Edge.txt

?????文件?????204336??2017-05-16?14:05??實驗2-4\GraphCPro\Debug\Graph.obj

?????文件??????94208??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\GraphCPro.exe

?????文件????????406??2017-05-09?15:24??實驗2-4\GraphCPro\Debug\GraphCPro.exe.embed.manifest

?????文件????????472??2017-05-09?15:26??實驗2-4\GraphCPro\Debug\GraphCPro.exe.embed.manifest.res

?????文件????????381??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\GraphCPro.exe.intermediate.manifest

?????文件????1007180??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\GraphCPro.ilk

?????文件?????????86??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\GraphCPro.lastbuildstate

?????文件???????2320??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\GraphCPro.log

?????文件????1068032??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\GraphCPro.pdb

?????文件???????1449??2017-05-09?15:21??實驗2-4\GraphCPro\Debug\GraphCPro.vcxprojResolveAssemblyReference.cache

?????文件??????????0??2017-05-09?15:24??實驗2-4\GraphCPro\Debug\GraphCPro.write.1.tlog

?????文件????????208??2017-05-09?15:24??實驗2-4\GraphCPro\Debug\GraphCPro_manifest.rc

?????文件??????????2??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\link-cvtres.read.1.tlog

?????文件??????????2??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\link-cvtres.write.1.tlog

?????文件??????????2??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\link.12988-cvtres.read.1.tlog

?????文件??????????2??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\link.12988-cvtres.write.1.tlog

?????文件??????????2??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\link.12988.read.1.tlog

?????文件??????????2??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\link.12988.write.1.tlog

?????文件???????3698??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\link.command.1.tlog

?????文件???????7562??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\link.read.1.tlog

?????文件???????2098??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\link.write.1.tlog

?????文件??????46218??2017-05-16?14:02??實驗2-4\GraphCPro\Debug\Main.obj

?????文件????????790??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\mt.command.1.tlog

?????文件????????650??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\mt.read.1.tlog

?????文件????????326??2017-05-16?14:10??實驗2-4\GraphCPro\Debug\mt.write.1.tlog

?????文件???????1094??2017-05-09?15:26??實驗2-4\GraphCPro\Debug\rc.command.1.tlog

............此處省略30個文件信息

評論

共有 條評論