全国交通咨询模拟系统源代码

全国交通咨询模拟系统源代码

ID:47549996

大小:35.56 KB

页数:55页

时间:2020-01-14

全国交通咨询模拟系统源代码_第1页
全国交通咨询模拟系统源代码_第2页
全国交通咨询模拟系统源代码_第3页
全国交通咨询模拟系统源代码_第4页
全国交通咨询模拟系统源代码_第5页
资源描述:

《全国交通咨询模拟系统源代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、12050741班(郭晓湛,李佳豪,廖川,杨鹤)课题:全国交通系统咨询模拟源程序代码:#include#include#include#include#include#include#defineINF65535//定义一个最大数定为无穷值#defineMAX23usingnamespacestd;staticintc_number=10;staticintk=0;staticintv=0,z=0,r=0,t=0;typedefstructsearch{in

2、tc_transer;intc_cost;intc_time;intf_cost;intf_time;}search;searchm[20],x[20],n[20];typedefintcostAdj[MAX+1][MAX+1];//图邻接矩阵从1开始记数intPath[MAX+1][MAX+1];//图邻接矩阵从1开始记数typedefstructunDiGraph{intnumVerts;//结点costAdjcost;//邻接矩阵}unDiGraph,*UNG;//图的定义typedefstructc_edit{chara[10];}c_edit;c_editadd

3、[10];costAdjB,L;//定位函数,输出城市列表,增添城市。intpr(inti,intj){inth=0;if(j==0){h=i;}elseif(j==1){cin>>add[i].a;}switch(h)//运用switch语句。{case(0):cout<<"";break;case(1):cout<<"成都";break;case(2):cout<<"西安";break;case(3):cout<<"郑州";break;case(4):cout<<"武汉";break;case(5):cout<<"株洲";break;case(6):cout<<"贵阳

4、";break;case(7):cout<<"柳州";break;case(8):cout<<"广州";break;case(9):cout<<"南宁";break;case(10):cout<<"徐州";break;default:cout<

5、(i,0);}cout<

6、number+1;j++){G->cost[i][j]=INF;//初始化使G->cost[i][j]为无穷。}}G->numVerts=c_number;G->cost[1][2]=G->cost[2][1]=112;G->cost[1][6]=G->cost[6][1]=190;G->cost[2][3]=G->cost[3][2]=136;G->cost[2][5]=G->cost[5][2]=325;G->cost[3][4]=G->cost[4][3]=142;G->cost[3][5]=G->cost[5][3]=230;G->cost[3][6]=G->co

7、st[6][3]=213;G->cost[4][7]=G->cost[7][4]=247;G->cost[4][8]=G->cost[8][4]=250;G->cost[5][7]=G->cost[7][5]=161;G->cost[5][9]=G->cost[9][5]=208;G->cost[5][10]=G->cost[10][5]=261;G->cost[6][8]=G->cost[8][6]=317;G->cost[7][8]=G->cost[8][7]=208;G->cost[8][10]=G->cost[10][

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。