当前位置:首页 » 中学校园 » 数据结构校园导游系统

数据结构校园导游系统

发布时间: 2021-05-24 21:05:18

❶ 数据结构校园导游程序

具体的问题说出来这样不好说~

❷ +100====c语言编写的简单校园导游系统=====>>跪求,正确答案

都忘光了呀

❸ 校园导游系统

校园导游系统的建议:1.计算机毕业设计可不能马虎,最好还是自己动动脑筋,好好的写一写。 2.网上那种免费的毕业设计千万不能采用,要么是论文不完整,要么是程序运行不了,最重要的是到处都是,老师随时都可以知道你是在网上随便下载的一套3.如果没有时间写,可以在网上找找付费的,我们毕业的时候也是为这个头疼了很长时间,最后在网上找了很久,终于购买了一套毕业设计,还算不错,开题报告+论文+程序+答辩演示都有,主要的都是他们技术做好的成品,保证论文的完整和程序的独立运行,可以先看了作品满意以后再付款,而且同一学校不重复,不存在欺骗的性质,那个网站的名字我记的不是太清楚了,你可以在网络或者GOOGLE上搜索------七七论文网,希望您可以找到

❹ 数据结构 校园导游系统的设计与实现(用c++实现)

#include <iostream.h>
#include<string.h>
#include <stdlib.h>
#include <fstream.h>
typedef struct Infor
{
char name[10];
char infor[100];
}Infor;
typedef struct
{ //图的定义
Infor vexs [20] ; //顶点表,用一维向量即可
int arcs[50][50]; //邻接矩阵
int vexnum, arcnum; //顶点总数,弧(边)总数

}Mgraph;

typedef struct
{
char password[6];
char n_password[6];

}PassWord;//密码结构体定义

int LocateVex(Mgraph &G,char a[10])//
{
for(int i=0;i<G.vexnum;i++)
{
if(strcmp(G.vexs[i].name,a)==0)
{
return i;
}
}
cout<<"输入有误!"<<endl;
return -1;
}

//////////////////////以上是头文件

#include "net.h"
#include <conio.h>//密码功能所需要调用的头文件

void Creategraph(Mgraph &G,PassWord &pw) //构造无向网
{
ifstream inFile("graph.txt");
char v1[10],v2[10];
int i,j,k,w;
inFile>>G.vexnum>>G.arcnum;
for(i=0;i<G.vexnum;i++)
{
inFile>>G.vexs[i].name;
inFile>>G.vexs[i].infor;
}
for(i=0;i<50;i++)
{
for(int j=0;j<50;j++)
{
G.arcs[i][j]=10000;
}
}
for(k=0;k<G.arcnum;k++)
{
inFile>>v1>>v2>>w;
i=LocateVex(G,v1);
j=LocateVex(G,v2);
if(i==j)
{
G.arcs[i][j]=0;
}
else
{
G.arcs[i][j]=w;
G.arcs[j][i]=G.arcs[i][j];
}
}
for(int m=0;m<6;m++)
{
inFile>>pw.password[m];
}
}

/////////////////////////////前台调用的函数/////////////////////////////////////

void infor(Mgraph &G)
{
char a[10];
int b=1;
while(b)
{
for(int i=0;i<G.vexnum;i++)
{
cout<<G.vexs[i].name<<endl;
}
cout<<"请输入要查找的景点信息"<<endl;
cin>>a;
for(i=0;i<G.vexnum;i++)
{
if(strcmp(G.vexs[i].name,a)==0)
{
cout<<G.vexs[i].infor<<endl;
b=0;
}

}
if(b!=0)
{
cout<<"输入错误请重新输入!!"<<endl;
}
cout<<"返回前台系统按0,继续查找按1"<<endl;
cin>>b;
}
}

void ShortestPath (Mgraph G)//最短路径
{
char a[10],d[10];
int b=1,i,j,v,v0,w;
int Dist[100],S[100],Path[100];
int n=G.vexnum;
while(b)
{
for(i=0;i<G.vexnum;i++)
{
cout<<G.vexs[i].name<<endl;
}
for(i=0;i<100;i++)
{
Dist[i]=9999;
S[i]=0;
Path[i]=-1;
}
cout<<"请输入要查询路径的两个景点"<<endl;
cin>>a;
cin>>d;
v0=LocateVex(G,a);
j=LocateVex(G,d);
for(v=0;v<n;v++)
{
S[v]=0;
Dist[v]=G.arcs[v0][v];
if(Dist[v]<9999)
Path[v]=v0;//v1是v的前趋
else
Path[v]=-1;//v无前趋
}//
Dist[v0]=0;
S[v0]=1;
for(i=1;i<n;i++)
{
int min=9999;
for(w=0;w<n;w++)
if(!S[w]&&Dist[w]<min)
{
v=w;
min=Dist[w];
}//w顶点离v1顶点更近
S[v]=1;
for(w=0;w<n;w++)//更新当前最短路径及距离
if(!S[w]&&(Dist[v]+G.arcs[v][w]<Dist[w]))
{
Dist[w]=Dist[v]+G.arcs[v][w];
Path[w]=v;
}//end if
}//end for
cout<<"距离为:"<<endl;
cout<<Dist[j]<<endl;
cout<<"要经过"<<endl;
int f=Path[j],e[100];
i=0;
while(f!=-1)
{
e[i]=f;
f=Path[f];
i++;
}
for(v=i-1;v>=0;v--)
{
cout<<G.vexs[e[v]].name<<"---->";
}
cout<<G.vexs[j].name<<endl;
cout<<"返回后台系统按0,继续删除按1"<<endl;
cin>>b;
}
}

void reception(Mgraph &G)//前台
{

int n;
while(1)
{
system("cls");//清屏
cout<<"*********************欢迎使用前台系统************************"<<endl;
cout<<"(1)景点信息查询"<<endl;
cout<<"(2)问路查询"<<endl;
cout<<"(0)返回上一级菜单"<<endl;
cin>>n;
switch(n)
{
case 1:
infor(G);
break;
case 2:
ShortestPath (G);
break;
case 0:
return;
break;
default:
cout<<"您的输入有误,任意键继续..."<<endl;
getch();

}
}
}

////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////后台调用的函数///////////////////////////////////
void WriteTXT(Mgraph G,PassWord pw)//将更改后的信息写如graph.txt
{
int i,j;
ofstream outFile("graph.txt");
if(!outFile)
{
cerr<<"cannot open my.txt"<<endl;
exit(1);
}
outFile<<G.vexnum<<" "<<G.arcnum<<endl;
for(i=0;i<G.vexnum;i++)
{
outFile<<G.vexs[i].name<<" "<<G.vexs[i].infor<<endl;
}

for(i=0;i<G.vexnum;i++)
{
for(j=0;j<G.vexnum;j++)
{
if(G.arcs[i][j]!=10000)
{
outFile<<G.vexs[i].name<<" "<<G.vexs[j].name<<" "<<G.arcs[i][j]<<endl;
G.arcs[j][i]=10000;
}
}
}
Creategraph(G,pw);
}
void ChangeP(Mgraph &G,PassWord pw)//修改一个已有景点的相关信息
{
char a[10];
int b=1,i;
while(b)
{
for(i=0;i<G.vexnum;i++)
{
cout<<G.vexs[i].name<<endl;
}
cout<<"请输入要修改的景点的信息"<<endl;
cin>>a;
for(i=0;i<G.vexnum;i++)
{
if(strcmp(a,G.vexs[i].name)==0)
{
cout<<G.vexs[i].infor<<endl;
cout<<"请输入该景点的修改后的信息"<<endl;
cin>>G.vexs[i].infor;
cout<<"修改成功!!!!"<<endl;
b=0;
}
}
if(b!=0)
{
cout<<"error!输入有误!"<<endl;
}
cout<<"保存请按1,不保存请按2"<<endl;
int c;
cin>>c;
if(c==1)
{
WriteTXT(G,pw);
}
cout<<"返回后台系统按0,继续修改按1"<<endl;
cin>>b;
}
}
void deleteP(Mgraph &G,PassWord pw)//删除景点信息
{
char a[10];
int b=1,i,j,k;
while(b)
{
for(i=0;i<G.vexnum;i++)
{
cout<<G.vexs[i].name<<endl;
}
cout<<"请输入要删除的景点的信息"<<endl;
cin>>a;
for(i=0;i<G.vexnum;i++)
{
if(strcmp(a,G.vexs[i].name)==0)
{
for(j=i;j<G.vexnum-1;j++)
{
G.vexs[j]=G.vexs[j+1];
for(k=0;k<G.vexnum-1;k++)
G.arcs[k][j]=G.arcs[k][j+1];
}
for(j=i;j<G.vexnum-1;j++)
{
for(k=0;k<G.vexnum-1;k++)
G.arcs[j][k]=G.arcs[j+1][k];
}
G.vexnum--;
G.arcnum=0;
for(i=0;i<G.vexnum;i++)
{
for(j=0;j<G.vexnum;j++)
{
if(G.arcs[i][j]!=10000)
G.arcnum++;
}
}
G.arcnum=G.arcnum/2;
b=0;
cout<<"删除成功!!!!"<<endl;
}
}
if(b!=0)
{
cout<<"输入有误!请看清楚!"<<endl;
}
cout<<"是否要保存?保存按1,不保存按2"<<endl;
int c;
cin>>c;
if(c==1)
{
WriteTXT(G,pw);
}
cout<<"返回后台系统按0,继续删除按1"<<endl;
cin>>b;
}
}

void deleteL(Mgraph &G,PassWord pw)//删除路径
{
char a[10],d[10];
int b=1,i,j;
while(b)
{
for(i=0;i<G.vexnum;i++)
{
for(j=0;j<G.vexnum;j++)
{
if(G.arcs[i][j]!=10000)
{
cout<<G.vexs[i].name<<" "<<G.vexs[j].name<<" "<<G.arcs[i][j]<<endl;
}
}
}
cout<<"请输入要删除的路径连接的两个景点名"<<endl;
cin>>a;
cin>>d;
i=LocateVex(G,a);
j=LocateVex(G,d);
if(G.arcs[i][j]!=10000)
{
G.arcs[i][j]=10000;
G.arcs[j][i]=10000;
b=0;
cout<<"删除成功!!"<<endl;
G.arcnum--;
}
if(b!=0)
{
cout<<"输入有误!!"<<endl;
}
cout<<"保存请按1,不保存请按2"<<endl;
int c;
cin>>c;
if(c==1)
{
WriteTXT(G,pw);
}
cout<<"返回后台系统按0,继续删除按1"<<endl;
cin>>b;
}
}
///////////////////////////////////选作//////////////////////////

void Add(Mgraph &G,PassWord &pw)//增加景点
{

cout<<"请输入景点名称:"<<endl;
cin>>G.vexs[G.vexnum].name;
cout<<"请输入景点信息:"<<endl;
cin>>G.vexs[G.vexnum].infor;

for(int i=0;i<G.vexnum;i++)
G.arcs[G.vexnum][i]=10000;
for(i=0;i<G.vexnum;i++)
G.arcs[i][G.vexnum]=10000;

G.arcs[G.vexnum][G.vexnum]=0;

G.vexnum++;

cout<<"增加成功!"<<endl;
cout<<endl;
WriteTXT(G,pw);
system("pause");system("cls");
}

////////////////////////////////////////////////
bool password(PassWord &pw)//判断密码
{
char p[6];
cout<<"请输入6位密码:"<<endl;
for(int e=0;e<6;e++)
{
p[e]=getch();
cout<<"*";
cout.flush();
}
cout<<endl;
for(e=0;e<6;e++)
{

if(p[e]!=pw.password[e])return false;
}
cout<<endl;
return true;
}

void backstage(Mgraph &G,PassWord pw)//后台函数
{
int n;
while(1)
{
system("cls");
cout<<"*********************欢迎使用后台系统************************"<<endl;
cout<<"(1)修改一个已有景点的相关信息"<<endl;
cout<<"(2)删除一个景点及其相关信息"<<endl;
cout<<"(3)删除一条路径"<<endl;
cout<<"(4)增加景点"<<endl;
cout<<"(0)返回上一级菜单"<<endl;
cin>>n;
switch(n)
{
case 1:
ChangeP(G,pw);
break;
case 2:
deleteP(G,pw);
break;
case 3:
deleteL(G,pw);
break;
case 4:
Add(G,pw);
break;
case 0:
return;
break;
default:
cout<<"您的输入有误,任意键继续..."<<endl;
getch();

}
}
}

////////////////////////////////////////////////////////////////////////////////////////////////

void main()//主函数
{
Mgraph G;
PassWord pw;
Creategraph(G,pw);
int n,m=1;
while(m)
{
system("cls");
cout<<"*********************欢迎使用北林游览系统************************"<<endl;
cout<<"(1)前台服务(游客身份登陆)"<<endl;
cout<<"(2)后台服务(管理员身份登陆)"<<endl;
cout<<"(0)退出"<<endl;
cin>>n;
switch(n)
{
case 1:
reception(G);
break;
case 2:
if(password(pw)==true)
{
backstage(G,pw);//后台函数,并调用
}
else
cout<<"密码输入错误!!";
break;
case 0:
m=0;
break;
default:
cout<<"您的输入有误,任意键继续..."<<endl;
getch();
}
}
}

❺ c语言版的数据结构课设-校园导游咨询!!!急急急!!

我只有C++的~~

#include<iostream>
#include<string>
using namespace std;
#define MaxVertexNum 50 /*景点个数最大50*/
#define MAXCOST 1000 /*定义路径的无穷大*/
#define T 8 /*目前景点个数*/

typedef struct
{
char name[20]; /*景点名称*/
char number[15]; /*景点代号*/
char introce[100]; /*景点简介*/
}Elemtype;
typedef struct
{
int num; /*顶点编号*/
Elemtype date; /*顶点信息*/
}Vertex; /*定义顶点*/

typedef struct
{
Vertex vexs[MaxVertexNum]; /*存放顶点的一维数组,数组第零个单元没有用上*/
unsigned int edges[MaxVertexNum][MaxVertexNum]; /*存放路径的长度*/
int n,e;
}MGraph;

MGraph MGr; /*全局变量,定义MGr为MGraph类型*/
int shortest[MaxVertexNum][MaxVertexNum]; /*定义全局变量存贮最小路径*/
int path[MaxVertexNum][MaxVertexNum]; /*定义存贮路径*/

void init()
{
int i,j;
MGr.vexs[1].num=1;
strcpy(MGr.vexs[1].date.name,"学校东门");
strcpy(MGr.vexs[1].date.number,"001");
strcpy(MGr.vexs[1].date.introce,"挨着三好街,购物很方便。");

MGr.vexs[2].num=2;
strcpy(MGr.vexs[2].date.name,"综合楼");
strcpy(MGr.vexs[2].date.number,"002");
strcpy(MGr.vexs[2].date.introce,"学校最新的大楼。");

MGr.vexs[3].num=3;
strcpy(MGr.vexs[3].date.name,"逸夫楼");
strcpy(MGr.vexs[3].date.number,"003");
strcpy(MGr.vexs[3].date.introce,"上课的地方。");

MGr.vexs[4].num=4;
strcpy(MGr.vexs[4].date.name,"教学馆");
strcpy(MGr.vexs[4].date.number,"004");
strcpy(MGr.vexs[4].date.introce,"上课的地方。");

MGr.vexs[5].num=5;
strcpy(MGr.vexs[5].date.name,"篮球场");
strcpy(MGr.vexs[5].date.number,"005");
strcpy(MGr.vexs[5].date.introce,"打篮球的地方。");

MGr.vexs[6].num=6;
strcpy(MGr.vexs[6].date.name,"大活");
strcpy(MGr.vexs[6].date.number,"006");
strcpy(MGr.vexs[6].date.introce,"开晚会搞活动的地方。");

MGr.vexs[7].num=7;
strcpy(MGr.vexs[7].date.name,"汉卿会堂");
strcpy(MGr.vexs[7].date.number,"007");
strcpy(MGr.vexs[7].date.introce,"开讲座的地方。");

MGr.vexs[8].num=8;
strcpy(MGr.vexs[8].date.name,"主楼");
strcpy(MGr.vexs[8].date.number,"008");
strcpy(MGr.vexs[8].date.introce,"做实验的地方。");

for(i=1;i<=T;i++)
{
for(j=1;j<=T;j++)
{
MGr.edges[i][j]=MAXCOST;
}
}
for(i=1;i<=T;i++)
{
shortest[i][i]=0;
} /*初始化*/
MGr.edges[1][2]=MGr.edges[2][1]=25;
MGr.edges[1][5]=MGr.edges[5][1]=15;
MGr.edges[1][3]=MGr.edges[3][1]=10;
MGr.edges[2][8]=MGr.edges[8][2]=30;
MGr.edges[5][7]=MGr.edges[7][5]=32;
MGr.edges[7][8]=MGr.edges[8][7]=12;
MGr.edges[6][7]=MGr.edges[7][6]=6;
MGr.edges[3][4]=MGr.edges[4][3]=24;
MGr.edges[4][6]=MGr.edges[6][4]=50;
MGr.edges[1][1]=MGr.edges[2][2]=MGr.edges[3][3]=MGr.edges[4][4]=0;
MGr.edges[5][5]=MGr.edges[6][6]=MGr.edges[7][7]=MGr.edges[8][8]=0;
}

void introce()
{
int n;
cout<<"请输入查询景点编号:"<<endl;
cin>>n;
switch(n)
{
case 1:
cout<<"景点编号:"<<MGr.vexs[1].date.number<<"景点名称:"<<MGr.vexs[1].date.name;
cout<<"景点简介:"<<MGr.vexs[1].date.introce<<endl;
break;
case 2:
cout<<"景点编号:"<<MGr.vexs[2].date.number<<"景点名称:"<<MGr.vexs[2].date.name;
cout<<"景点简介:"<<MGr.vexs[2].date.introce<<endl;
break;
case 3:
cout<<"景点编号:"<<MGr.vexs[3].date.number<<"景点名称:"<<MGr.vexs[3].date.name;
cout<<"景点简介:"<<MGr.vexs[3].date.introce<<endl;
break;
case 4:
cout<<"景点编号:"<<MGr.vexs[4].date.number<<"景点名称:"<<MGr.vexs[4].date.name;
cout<<"景点简介:"<<MGr.vexs[4].date.introce<<endl;
break;
case 5:
cout<<"景点编号:"<<MGr.vexs[5].date.number<<"景点名称:"<<MGr.vexs[5].date.name;
cout<<"景点简介:"<<MGr.vexs[5].date.introce<<endl;
break;
case 6:
cout<<"景点编号:"<<MGr.vexs[6].date.number<<"景点名称:"<<MGr.vexs[6].date.name;
cout<<"景点简介:"<<MGr.vexs[6].date.introce<<endl;
break;
case 7:
cout<<"景点编号:"<<MGr.vexs[7].date.number<<"景点名称:"<<MGr.vexs[7].date.name;
cout<<"景点简介:"<<MGr.vexs[7].date.introce<<endl;
break;
case 8:
cout<<"景点编号:"<<MGr.vexs[8].date.number<<"景点名称:"<<MGr.vexs[8].date.name;
cout<<"景点简介:"<<MGr.vexs[8].date.introce<<endl;
break;
default:
cout<<"输入序号错误。";
break;
}
}
void floyd()
{
int i,j,k;
for(i=1;i<=T;i++)
{
for(j=1;j<=T;j++)
{
shortest[i][j]=MGr.edges[i][j];
path[i][j]=0;
}
} /*初始化数组*/
for(k=1;k<=T;k++)
{
for(i=1;i<=T;i++)
{
for(j=1;j<=T;j++)
{
if(shortest[i][j]>(shortest[i][k]+shortest[k][j]))
{
shortest[i][j]=shortest[i][k]+shortest[k][j];
path[i][j]=k;
path[j][i]=k;/*记录经过的路径*/
}//end_if
}
}
}//end_for
}
void display(int i,int j)
{/* 打印两个景点的路径及最短距离 */
int a,b;
a=i;
b=j;
cout<<"您要查询的两景点间最短路径是:\n\n";
if(shortest[i][j]!=MaxVertexNum)
{
if(i<j)
{
cout<<b;
while(path[i][j]!=0)
{/* 把i到j的路径上所有经过的景点按逆序打印出来*/
cout<<"<-"<<path[i][j];
if(i<j)
j=path[i][j];
else
i=path[j][i];
}
cout<<"<-"<<a;
cout<<"\n\n";
cout<<a<<"->"<<b<<"最短距离是"<<shortest[a][b]<<"米"<<"\n\n";
}
else
{
cout<<a;
while(path[i][j]!=0)
{/* 把i到j的路径上所有经过的景点按顺序打印出来*/
cout<<"->"<<path[i][j];
if(i<j)
j=path[i][j];
else
i=path[j][i];
}
cout<<"->"<<b;
cout<<"\n\n";
cout<<a<<"->"<<b<<"最短距离是:"<<shortest[a][b]<<"米\n\n"<<endl;
}
}
else
cout<<"输入错误!不存在此路!\n\n";
}/*display*/
int shortestdistance()
{/*要查找的两景点的最短距离*/
int i,j;
cout<<"请输入要查询的两个景点的编号(1->8的数字编号并用' '间隔):";
cin>>i>>j;
if(i>T||i<=0||j>T||j<0)
{
cout<<"输入信息错误!\n\n";
cout<<" 请输入要查询的两个景点的编号(1->8的数字编号并用' '间隔):\n";
cin>>i>>j;
}
else
{
floyd();
display(i,j);
}
return 1;
}/*shortestdistance*/

void main()
{
char k;
init();
cout<<"*******************************************************************\n";
cout<<"* *\n";
cout<<"* *\n";
cout<<"* 欢迎使用校园导游咨询 *\n";
cout<<"* *\n";
cout<<"******************************************************************\n";
while(1)
{
cout<<"1.景点信息查询请按 i 键\n";
cout<<"2.景点最短路径查询请按 s 键\n";
cout<<"3.退出系统请按 e 键\n";
cout<<"请选择服务:";
cin>>k;

switch(k)
{
case 'i':
cout<<"景点简介查询(请输入1~8)。";
introce();
break;
case 's':
cout<<"景点最短路径查询。";
shortestdistance();
break;
case 'e':
exit(0);

}
}
system("pause");
}

❻ 数据结构课程设计问题:校园导游图

这么麻烦的东西是要拿真钱做悬赏的

热点内容
南京教育咨询公司 发布:2025-08-25 14:53:20 浏览:632
2017年陕西数学 发布:2025-08-25 11:13:28 浏览:808
千笔教学 发布:2025-08-25 10:13:14 浏览:178
最美乡村教师马剑霞 发布:2025-08-25 09:48:41 浏览:504
认识米的教学反思 发布:2025-08-25 08:32:43 浏览:788
游褒禅山记教学反思 发布:2025-08-25 03:51:39 浏览:894
监禁姐妹教师西瓜 发布:2025-08-25 03:19:29 浏览:790
李德印老师 发布:2025-08-25 02:35:21 浏览:859
硝酸钙的化学式 发布:2025-08-24 20:54:14 浏览:595
四平招聘教师 发布:2025-08-24 19:15:36 浏览:290