資源簡介
數據結構課設
校園導游系統
C++源碼
需要的拿去
代碼片段和文件信息
#include?
using?namespace?std;
#define?vex?10???????//頂點
#define?arc?10????????
#define?max?1000???????
struct?view??????????//景點
{
char?name[50];
char?intro[300];??//介紹
};//景點結構體
struct?mgraph????????//圖
{
view?vexs[vex];???????????//頂點
int?arcs[vex][arc];???????//邊
int?vex_numarcs_num;?????//頂點數和邊數
};
mgraph?U;//建立圖U
?struct?SqStack{
int?*base;
int?*top;
int?size;
};//棧
int?initstack(SqStack?&s)
{
s.base=new?int[max];
if(!s.base)?exit(1);
s.top=s.base;
s.size=max;
return?1;
}//初始化棧
int?push(SqStack?&sint?x)
{
if?(s.top-s.base>=s.size)
return?0;
*s.top++=x;
return?1;
}
int?pop(SqStack?&sint?&x)
{
if?(s.top==s.base)
return?0;
x=*--s.top;
return?1;
}
void?jingdian()
{
//初始化景點
strcpy(U.vexs[
- 上一篇:推箱子游戲—c語言實訓
- 下一篇:Visual C++練習-學生考勤管理系統
評論
共有 條評論