公交查询系统 - 图文(8)

2019-09-01 19:26

using namespace std; #define MAX_USER 100 #define INIT_STATION 30 #define MAX_STATION 50 #define MAX_LINE 10

//#define INT_MAX 0x3f3f3f3f struct busGraph{ char stationName[25];

int theStationToOthersPath[MAX_STATION]; int busLines[MAX_LINE]; int linesCount; int exist; };

int main()

{ struct busGraph BG[MAX_STATION]; /*

0 汽车北站 1 开福区政府 2 伍家岭北 3马场 4 八家大屋 5 洪山桥 6 长沙大学 7 月湖公园 8 世界之窗 9 汽车东站 10华夏 11九尾冲 12 国防科大 13喻家冲 14 三一大道口 15德雅路口 16长沙晚报 17 南湖大市场 18 车站北路口 19 蓉园小区 20 五里牌 21火车站 22 袁家岭 23 省军区 24 中山亭 25 湘雅医院 26省博物馆 27长沙市一中 28烈士公园 29 年嘉湖 */

for(int i = 0 ; i < MAX_STATION ;i++) { BG[i].exist = 0;

for(int j = 0 ; j < MAX_STATION ;j++) BG[i] .theStationToOthersPath[j] = INT_MAX; }

for(int i = 0 ; i < MAX_STATION ;i++) {

BG[i].linesCount = 0;

for(int j = 0 ; j < MAX_LINE ; j ++) BG[i] .busLines[j] = 0; }

// BG[i] .busLines[j] = 0; for(int i = 0 ; i < 30 ; i++) {

BG[i].exist = 1; }

strcpy_s( BG[0].stationName ,10,\汽车北站 \); strcpy_s( BG[1].stationName ,11,\开福区政府\); strcpy_s( BG[2].stationName ,9,\伍家岭北\); strcpy_s( BG[3].stationName ,6,\马场 \); strcpy_s( BG[4].stationName ,10,\八家大屋 \);

29

strcpy_s( BG[5].stationName ,7,\洪山桥\); strcpy_s( BG[6].stationName ,9,\长沙大学\); strcpy_s( BG[7].stationName ,10,\月湖公园 \); strcpy_s( BG[8].stationName ,9,\世界之窗\); strcpy_s( BG[9].stationName ,10,\汽车东站 \); strcpy_s( BG[10].stationName ,5,\华夏\); strcpy_s( BG[11].stationName ,7,\九尾冲\); strcpy_s( BG[12].stationName ,9,\国防科大\); strcpy_s( BG[13].stationName ,7,\喻家冲\); strcpy_s( BG[14].stationName ,11,\三一大道口\); strcpy_s( BG[15].stationName ,9,\德雅路口\); strcpy_s( BG[16].stationName ,9,\长沙晚报\); strcpy_s( BG[17].stationName ,11,\南湖大市场\); strcpy_s( BG[18].stationName ,11,\车站北路口\); strcpy_s( BG[19].stationName ,10,\蓉园小区 \); strcpy_s( BG[20].stationName ,8,\五里牌\); strcpy_s( BG[21].stationName ,7,\火车站\); strcpy_s( BG[22].stationName ,7,\袁家岭\); strcpy_s( BG[23].stationName ,7,\省军区\); strcpy_s( BG[24].stationName ,7,\中山亭\); strcpy_s( BG[25].stationName ,9,\湘雅医院\); strcpy_s( BG[26].stationName ,9,\省博物馆\); strcpy_s( BG[27].stationName ,12,\长沙市一中 \); strcpy_s( BG[28].stationName ,10,\烈士公园 \); strcpy_s( BG[29].stationName ,7,\年嘉湖\);

BG[0].busLines[0]=1; BG[0].busLines[1]=1; BG[0].busLines[2]=1; BG[0].busLines[4]=1; BG[0].linesCount = 4;

BG[1].busLines[0]=1; BG[1].busLines[1]=1; BG[1].busLines[2]=1; BG[1].busLines[4]=1; BG[1].linesCount = 4;

BG[2].busLines[0]=1; BG[2].busLines[1]=1; BG[2].busLines[2]=1; BG[2].busLines[4]=1; BG[2].linesCount = 4;

30

BG[3].busLines[0]=1; BG[3].busLines[1]=1; BG[3].linesCount = 2;

BG[4].busLines[0]=1; BG[4].busLines[1]=1; BG[4].linesCount = 2;

BG[5].busLines[0]=1; BG[5].busLines[1]=1; BG[5].linesCount = 2;

BG[6].busLines[0]=1; BG[6].busLines[1]=1; BG[6].busLines[5]=1; BG[6].linesCount = 3;

BG[7].busLines[0]=1; BG[7].busLines[5]=1; BG[7].linesCount = 2;

BG[8].busLines[0]=1; BG[8].busLines[2]=1; BG[8].busLines[3]=1; BG[8].busLines[5]=1; BG[8].linesCount = 3;

BG[9].busLines[0]=1; BG[9].busLines[1]=1; BG[9].busLines[3]=1; BG[9].busLines[5]=1; BG[9].linesCount = 4;

BG[10].busLines[3]=1; BG[10].busLines[4]=1; BG[10].linesCount = 2;

BG[11].busLines[2]=1; BG[11].busLines[4]=1; BG[11].linesCount = 2;

BG[12].busLines[2]=1; BG[12].linesCount = 1;

31

BG[13].busLines[2]=1; BG[13].linesCount = 1;

BG[14].busLines[1]=1; BG[14].busLines[2]=1; BG[14].busLines[3]=1; BG[14].linesCount = 3;

BG[15].busLines[1]=1; BG[15].busLines[2]=1; BG[15].busLines[3]=1; BG[15].busLines[5]=1; BG[15].linesCount = 4;

BG[16].busLines[5]=1; BG[16].linesCount = 1;

BG[17].busLines[5]=1; BG[17].linesCount = 1;

BG[18].busLines[5]=1; BG[18].linesCount = 1;

BG[19].busLines[5]=1; BG[19].linesCount = 1;

BG[20].busLines[5]=1; BG[20].linesCount = 1;

BG[21].busLines[1]=1; BG[21].busLines[4]=1; BG[21].busLines[5]=1; BG[21].linesCount = 1;

BG[22].busLines[4]=1; BG[22].linesCount = 1;

BG[23].busLines[4]=1; BG[23].linesCount = 1;

BG[24].busLines[4]=1; BG[24].linesCount = 1;

BG[25].busLines[3]=1;

32

BG[25].linesCount = 1;

BG[26].busLines[3]=1; BG[26].linesCount = 1;

BG[27].busLines[3]=1; BG[27].linesCount = 1;

BG[28].busLines[1]=1; BG[28].busLines[3]=1; BG[28].linesCount = 2;

BG[29].busLines[1]=1; BG[29].busLines[3]=1; BG[29].linesCount = 2;

BG[0].theStationToOthersPath[1]=100;

BG[1].theStationToOthersPath[0]=100; BG[1].theStationToOthersPath[2]=150;

BG[2].theStationToOthersPath[1]=150; BG[2].theStationToOthersPath[3]=170; BG[2].theStationToOthersPath[11]=100;

BG[3].theStationToOthersPath[2]=170; BG[3].theStationToOthersPath[4]=130;

BG[4].theStationToOthersPath[3]=130; BG[4].theStationToOthersPath[5]=70;

BG[5].theStationToOthersPath[4]=70; BG[5].theStationToOthersPath[6]=100;

BG[6].theStationToOthersPath[5]=100; BG[6].theStationToOthersPath[7]=50; BG[6].theStationToOthersPath[15]=250;

BG[7].theStationToOthersPath[6]=50; BG[7].theStationToOthersPath[8]=170;

BG[8].theStationToOthersPath[7]=170; BG[8].theStationToOthersPath[9]=160;

33


公交查询系统 - 图文(8).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:美国高校创业教育

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: