校园导游系统设计与实现毕业设计论文(编辑修改稿)内容摘要:

exit(0)。 default: cout 您的输入有误 ,任意键继续 ...。 getch()。 } } } void initgraph(mgraph amp。 G){ //依据读入的图的顶点个数和边的条数, //分别初始化图结构中图的顶点向量数组和图的邻接矩阵 int i,j。 for(i=0。 iN。 i++) for(j=0。 jN。 j++) [i][j]=9999。 for(i=0。 i30。 i++){ strcpy([i].name,Name[i])。 strcpy([i].inf,inform[i])。 } =30。 =45。 [0][1]=55。 [1][0]=55。 [0][5]=287。 [5][0]=287。 [1][2]=243。 [2][1]=243。 [2][3]=28。 [3][2]=28。 [3][4]=31。 [4][3]=31。 [4][5]=42。 [5][4]=42。 [4][9]=106。 [9][4]=106。 [5][6]=87。 [6][5]=87。 [5][7]=71。 [7][5]=71。 [7][8]=132。 [8][7]=132。 [7][9]=97。 [9][7]=97。 [7][12]=150。 [12][7]=150。 [8][9]=111。 [9][8]=111。 [8][11]=151。 [11][8]=151。 [8][13]=126。 [13][8]=126。 [9][11]=257。 [11][9]=257。 [10][11]=33。 [11][10]=33。 [10][13]=128。 [13][10]=128。 [10][27]=287。 [27][10]=287。 [12][13]=117。 [13][12]=117。 [12][14]=83。 [14][12]=83。 [12][16]= [16][12]= [13][26]=359。 [26][13]=359。 [14][15]=118。 [15][14]=118。 [14][16]=245。 [16][14]=245。 [15][22]=94。 [22][15]=94。 [15][26]=176。 [26][15]=176。 [16][18]=62。 [18][16]=62。 [17][18]=74。 [18][17]=74。 [17][19]=88。 [19][17]=88。 [17][22]=218。 [22][17]=218。 [19][20]=64。 [20][19]=64。 [20][21]=167。 [21][20]=167。 [21][22]=68。 [22][21]=68。 [21][23]=132。 [23][21]=132。 [23][26]=203。 [26][23]=203。 [23][29]=60。 [29][23]=60。 [24][25]=129。 [25][24]=129。 [24][28]=263。 [28][24]=263。 [24][29]=80。 [29][24]=80。 [25][26]=181。 [26][25]=181。 [25][27]=212。 [27][25]=212。 [25][28]=192。 [28][25]=192。 [26][27]=164。 [27][26]=164。 [27][28]=354。 [28][27]=354。 } void cgraph(mgraph amp。 G,Password amp。 pw){ //写入文件并初始化 int i,j,dist。 char c。 ifstream infile()。 if(!infile){ ()。 writetxt(G,pw)。 } else{ ()。 ifstream infile()。 infile。 for(i=0。 i。 i++){ infile[i].name。 infile[i].inf。 } for(i=0。 i。 i++){ for(j=0。 j。 j++){ infiledist。 [i][j]=dist。 } } for(i=0。 i6。 i++) infile[i]。 ()。 } } void writetxt(mgraph amp。 G,Password amp。 pw){ //写入文件 int i,j。 ofstream outfile()。 outfileendlendl。 for(i=0。 i。 i++){ outfile[i].nameendl[i].infendl。 } for(i=0。 i。 i++){ for(j=0。 j。 j++){ outfile[i][j]。 } } for(i=0。 i6。 i++) outfile[i]。 ()。 } void browse(mgraph G){ //输出学校全部景点的信息 :编号、名称 int j=0,k。 for(int i=0。 i。 i++){ k=i+1。 coutk.[i].name39。 \t39。 j++。 if(j%3==0)coutendl。 } if(j%3!=0)coutendl。 } int pass(Password pw){ char ch[6],judge=1。 cout 请输入密码:。 for(int i=0。 i6。 i++){ ch[i]=getch()。 ()。 cout*。 } for(int i=0。 i6。 i++){ if([i]!=ch[i]) judge=0。 } return judge。 } void changepw(mgraph amp。 G,Password amp。 pw){ int i,b=1。 char ch[6],ch1[6],judge1=1,judge2=1。 while(b==1){ cout请输入原密码: endl。 for(i=0。 i6。 i++){ ch[i]=getch()。 ()。 cout*。 } for(i=0。 i6。 i++){ if([i]!=ch[i]) judge1=0。 } if(judge1){ coutendl请输入新密码: endl。 for(i=0。 i6。 i++){ ch[i]=getch()。 ()。 cout*。 } coutendl请确认新密码: endl。 for(i=0。 i6。 i++){ ch1[i]=getch()。 ()。 cout*。 } for(i=0。 i6。 i++){ if(ch[i]!=ch1[i])judge2=0。 } if(judge2){ for(i=0。 i6。 i++){ [i]=ch[i]。 } coutendl修改成功。 endl。 writetxt(G,pw)。 } else coutendl修改错误。 endl。 } else cout密码错误。 endl。 coutendl返回后台系统按 0,继续修改按 1endl。 cinb。 coutendl。 } } /////////////////////////前台 ///////////////////////////////////////// void reception(mgraph amp。 G){ //前台函数 int n,i,j。 while(1) { system(cls)。 //清屏 cout********************* 欢迎使用前台系统*******************endl。 cout(1)个别景点信息查询 endl。 cout(2)问路查询 endl。 cout(3)输出所有景点信息 endl。 cout(4)相邻的景点及其距离 endl。 cout(0)返回上一级菜单 endl。 co。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。