广东海洋大学公交换乘系统课程设计.docx
《广东海洋大学公交换乘系统课程设计.docx》由会员分享,可在线阅读,更多相关《广东海洋大学公交换乘系统课程设计.docx(25页珍藏版)》请在冰点文库上搜索。
广东海洋大学公交换乘系统课程设计
广东海洋大学信息学院
课程设计报告
设计题目
公交换乘系统
课程名称
数据结构
姓名(学号)
201411621146
联系电话
专业名称
计算机科学与技术
所在班级
计科1141
指导教师
谢仕义
教师职称
教授
起止时间
2015年11月20日至2015年12月26日
评定成绩
目录
一、课程设计主要内容………………………………………P3
1.1概况…………………………………………………………….P3
1.2主要内容……………………………..………………….…P4
1.3开发环境和工具………………………………..…………….P4
二、功能和结构设计………………………………………….P4
三、流程图和算法设计……………………………………………P4
四、源程序代码………………………………………….…..P9
五、课程设计总结………………………………………….…..P17
5.1优点……………………………………………………P17
5.2缺点……………………………………………………P17
5.3自我总结……………………………………………P17
六、参考资料……………………………………………….…..P18
一、课程设计主要内容
1.1概况
名称:
用途:
交通运输公司、乘客
功能:
实现最优路线的显示
1.2主要内容
公交换乘在一个城市的公共交通系统设计中占据着极其重要的地位,公交换乘的过程将直接影响居民出行时间的长短,公交换乘的过程如下:
指定一起始公交站点与目的公交站点,依据参考因素,例如:
换乘路线的路径最短、耗费时间最短、所需车资最少等,经过分析处理得到可达目的站点换乘次数最少的乘车方案,具体可分为:
(1)零次换乘起始站点和目的站点之间存在可直达的公交线路,即出行居民无需转乘就可以直接到达目的站点,这也是较为理想的方案。
(2)一次换乘起始站点和目的站点之间没有公交车直接往返,即两站点之间不存在可直达的公交线路,则出行居民需要在途经的某个站点下车,然后转乘另一线路公交车才能达到目的站点。
(3)多次换乘在起始站点和目的站点之间没有可直达的公交线路,出行居民需要经过一次以上的转乘才能达到目的站点,则得到多次换乘方案。
多次换乘方案可通过一次换乘的递归计算得到,一般情况下,超过两次转乘的方案对于出行居民来说是难以接受的,本课程设计只要求计算零次和一次换乘方案,对于一次以上的公交换乘不作要求。
下面以图所示的公交线路图为例,来看一下公交换乘方案的选择。
在该交通公交线路图网中共有1线、2线、3线3条公交线路,每条线路各布有若干个公交站点(与公交线路对应颜色的小圆点标示),其中黑色圆点表示换乘站点,即不同线路共同经过的公交站点。
例如,某一居民在湾桥站乘车前往目的站点建新东路站,则该居民可乘坐2线公交车即可直达目的站点,即零次换乘;如果该居民前往目的站点海运集团公司站,分析该公交线路可知该居民有两种一次换乘的乘车方案:
其一是该居民在湾桥站乘坐2线公车到农垦医院站,然后再换乘1线公交车直到海运集团公司站;其二是该居民在湾桥站乘坐2线公车直到霞湖医院站,再换乘1线公交车到海运集团公司站;同理,仿照一次换乘的方法可得到其他多次换乘的乘车方案,用户可以自行分析。
1.3开发环境和工具
开发语言:
C++程序设计语言
开发软件:
VisualC++6.0
二、功能和结构设计
1)输入出发点:
2)输入终点:
3)查询结果:
三、流程图和算法设计
用户通过输入起始站点和终点站来获取公交线路信息,流程图如下:
算法:
(1)首先建立3个一位数组保存各个站点信息。
具体算法如下:
Busline:
:
Busline(stringp[],intn)//构造函数,初始化公交线路站点信息
{
if(n>pathlen)throw"上溢";
for(inti=0;i{bus[i]=p[i];}}stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pathlen]={"海滨医院站","海滨宾馆站","儿童公园站","广州湾站","建设路站","湛江汽车南站","人民大道中巴专线","世纪广场站"};Buslinea(path1,7);Buslineb(path2,11);Buslinec(path3,8);(2)判断乘客是否需要换乘,即起点和终点是否位于同一条公交线上:1)如果可以直达,起点和终点位于同一条公交线上,算法如下:voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;//count1,count2用于记录经过的站点数for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else//起点下标大于终点下标{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;//统计经过的站点个数cout<cout<<"共经过站点数为:";cout<}2)如果需要换乘,起点和终点位于不同一条公交线上,若有多种换乘方案,则选取经过站点数最少的方案,即最优路线作为输出,算法如下:voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;//i是起点下标,j是终点下标intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点{if(i<=l)//起点下标小于交点下标{cout<<"该路线为:"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
bus[i]=p[i];
}
stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};
stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};
stringpath3[pathlen]={"海滨医院站","海滨宾馆站","儿童公园站","广州湾站","建设路站","湛江汽车南站","人民大道中巴专线","世纪广场站"};
Buslinea(path1,7);
Buslineb(path2,11);
Buslinec(path3,8);
(2)判断乘客是否需要换乘,即起点和终点是否位于同一条公交线上:
1)如果可以直达,起点和终点位于同一条公交线上,算法如下:
voidBusline:
through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点
qd=i;intcount1=0,count2=0,sum1=0;//count1,count2用于记录经过的站点数
for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else//起点下标大于终点下标{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;//统计经过的站点个数cout<cout<<"共经过站点数为:";cout<}2)如果需要换乘,起点和终点位于不同一条公交线上,若有多种换乘方案,则选取经过站点数最少的方案,即最优路线作为输出,算法如下:voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;//i是起点下标,j是终点下标intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点{if(i<=l)//起点下标小于交点下标{cout<<"该路线为:"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
if(fp==p[j])
cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else//起点下标大于终点下标{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;//统计经过的站点个数cout<cout<<"共经过站点数为:";cout<}2)如果需要换乘,起点和终点位于不同一条公交线上,若有多种换乘方案,则选取经过站点数最少的方案,即最优路线作为输出,算法如下:voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;//i是起点下标,j是终点下标intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点{if(i<=l)//起点下标小于交点下标{cout<<"该路线为:"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else//起点下标大于终点下标{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;//统计经过的站点个数cout<cout<<"共经过站点数为:";cout<}2)如果需要换乘,起点和终点位于不同一条公交线上,若有多种换乘方案,则选取经过站点数最少的方案,即最优路线作为输出,算法如下:voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;//i是起点下标,j是终点下标intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点{if(i<=l)//起点下标小于交点下标{cout<<"该路线为:"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else//起点下标大于终点下标{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;//统计经过的站点个数cout<cout<<"共经过站点数为:";cout<}2)如果需要换乘,起点和终点位于不同一条公交线上,若有多种换乘方案,则选取经过站点数最少的方案,即最优路线作为输出,算法如下:voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;//i是起点下标,j是终点下标intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点{if(i<=l)//起点下标小于交点下标{cout<<"该路线为:"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"该路线为:
"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else//起点下标大于终点下标{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;//统计经过的站点个数cout<cout<<"共经过站点数为:";cout<}2)如果需要换乘,起点和终点位于不同一条公交线上,若有多种换乘方案,则选取经过站点数最少的方案,即最优路线作为输出,算法如下:voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;//i是起点下标,j是终点下标intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点{if(i<=l)//起点下标小于交点下标{cout<<"该路线为:"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(intk=i;k<=j-1;k++)
cout<
";
count1++;
else//起点下标大于终点下标
"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;//统计经过的站点个数cout<cout<<"共经过站点数为:";cout<}2)如果需要换乘,起点和终点位于不同一条公交线上,若有多种换乘方案,则选取经过站点数最少的方案,即最优路线作为输出,算法如下:voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;//i是起点下标,j是终点下标intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点{if(i<=l)//起点下标小于交点下标{cout<<"该路线为:"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(intk=i;k>=j+1;k--)
count2++;
sum1=count1+count2+1;//统计经过的站点个数
cout<cout<<"共经过站点数为:";cout<}2)如果需要换乘,起点和终点位于不同一条公交线上,若有多种换乘方案,则选取经过站点数最少的方案,即最优路线作为输出,算法如下:voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;//i是起点下标,j是终点下标intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点{if(i<=l)//起点下标小于交点下标{cout<<"该路线为:"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"共经过站点数为:
cout<}2)如果需要换乘,起点和终点位于不同一条公交线上,若有多种换乘方案,则选取经过站点数最少的方案,即最优路线作为输出,算法如下:voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;//i是起点下标,j是终点下标intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点{if(i<=l)//起点下标小于交点下标{cout<<"该路线为:"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
2)如果需要换乘,起点和终点位于不同一条公交线上,若有多种换乘方案,则选取经过站点数最少的方案,即最优路线作为输出,算法如下:
transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[])
qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;//i是起点下标,j是终点下标
intsum1=0,sum2=0;
for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点{if(i<=l)//起点下标小于交点下标{cout<<"该路线为:"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点{if(i<=l)//起点下标小于交点下标{cout<<"该路线为:"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
if(fp==p1[h]&&sp==p2[k])
for(intx=0;x<4;x++)
for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点{if(i<=l)//起点下标小于交点下标{cout<<"该路线为:"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点{if(i<=l)//起点下标小于交点下标{cout<<"该路线为:"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
if(a[x]==p2[l]&&a[x]==p1[l1])//a[x]为换乘前后路线的交点
if(i<=l)//起点下标小于交点下标
{cout<<"该路线为:
"<for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(inty=i;y{cout<";//输出换乘之前的站点count1++;//统计站点个数}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<";//输出换乘之前的站点
count1++;//统计站点个数
if(j<=l1)//终点下标小于交点下标
cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"然后在"<for(intz=l1;z>j;z--){count2++;//统计站点个数cout<";//输出换乘后的站点}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(intz=l1;z>j;z--)
count2++;//统计站点个数
cout<";//输出换乘后的站点
cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
elseif(j>l1)//终点下标大于交点下标
cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<";
cout<}sum1=count1+count2+1;//换乘前后总共经过的站点数cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
sum1=count1+count2+1;//换乘前后总共经过的站点数
cout<cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"------------------------------------"<}elseif(i>l)//起点下标大于交点下标{cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
elseif(i>l)//起点下标大于交点下标
"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1)//终点下标小于交点下标{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(inty=i;y>l;y--)
count3++;
{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
count4++;
cout<}elseif(j>l1)//终点下标大于交点下标{cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
sum2=count3+count4+1;
cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
if(sum1!
=0&&sum2!
=0)
if(sum1<=sum2)
cout<<"同一转乘方式下,最优路线为:
共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
else
共经过站点数为"<"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
"<}四、源程序代码#include#includeusingnamespacestd;constintpathlen=11;intqd,zd;//起点,终点的下标stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点//intconstcount1=0,count2=0,count3=0,count4=0;//intconstsum1=0,sum2=0;classBusline{public:Busline(stringp[],intn);voidthrough(inti,stringsp,stringfp,stringp[],intl);voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);voidmap();private:stringbus[pathlen];}; Busline::Busline(stringp[],intn)//构造函数,初始化公交线路站点信息{if(n>pathlen)throw"上溢";for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
四、源程序代码
#include
usingnamespacestd;
constintpathlen=11;
intqd,zd;//起点,终点的下标
stringa[4]={"农垦医院站","广州湾站","霞湖医院站","海滨宾馆站"};//转乘站点
//intconstcount1=0,count2=0,count3=0,count4=0;
//intconstsum1=0,sum2=0;
classBusline
public:
Busline(stringp[],intn);
voidthrough(inti,stringsp,stringfp,stringp[],intl);
voidtransfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]);
voidmap();
private:
stringbus[pathlen];
};
for(inti=0;i{bus[i]=p[i];}}voidBusline::through(inti,stringsp,stringfp,stringp[],intl)//l为公交专线,i是站点下标,sp是出发点,fp是终点{qd=i;intcount1=0,count2=0,sum1=0;for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
qd=i;intcount1=0,count2=0,sum1=0;
for(intj=0;jif(fp==p[j]){cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"可以直达,乘坐"<"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
"<if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
if(i{cout<<"该路线为:"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
"<for(intk=i;k<=j-1;k++){cout<";count1++;}cout<}else{cout<<"该路线为:"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
"<for(intk=i;k>=j+1;k--){cout<";count2++;}cout<}}sum1=count1+count2+1;cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
sum1=count1+count2+1;
cout<cout<<"共经过站点数为:";cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<} voidBusline::transfer(inti,intj,stringsp,stringfp,stringp1[],stringp2[]){qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;intsum1=0,sum2=0;for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
qd=i;zd=j;intcount1=0,count2=0,count3=0,count4=0;
for(intk=0;kfor(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(inth=0;hif(fp==p1[h]&&sp==p2[k]){for(intx=0;x<4;x++)for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(intl=0;lfor(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(intl1=0;l1{if(a[x]==p2[l]&&a[x]==p1[l1]){if(i<=l){cout<<"该路线为:"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
if(a[x]==p2[l]&&a[x]==p1[l1])
if(i<=l)
"<for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(inty=i;y{cout<";count1++;}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
if(j<=l1)
cout<cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"然后在"<for(intz=l1;z>j;z--){count2++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
elseif(j>l1)
cout<cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"然后在"<for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(intz=l1;z{count2++;cout<";}cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<}sum1=count1+count2+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"------------------------------------"<}elseif(i>l){cout<<"该路线为:"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
elseif(i>l)
"<for(inty=i;y>l;y--){count3++;cout<";}if(j<=l1){cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
{cout<cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"然后在"<for(intz=l1;z>j;z--){count4++;cout<";}cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<}elseif(j>l1){cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"然后在"<for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
for(intz=l1;z{count4++;cout<";}cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<}sum2=count3+count4+1;cout<<"共经过站点数为:";cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"------------------------------------"<}}}}if(sum1!=0&&sum2!=0){if(sum1<=sum2)cout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
{if(sum1<=sum2)
共经过站点数为"<"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
"<elsecout<<"同一转乘方式下,最优路线为:共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
共经过站点数为"<"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
"<}voidBusline::map(){cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
map(){
cout<<"湛江公交路线图"<cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"2线|"<cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"|"<cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"东华站○"<cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"||"<cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"湾桥站○潜水运动○海滨医院站"<cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"|学校站|海上城市站"<cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<" ̄农垦医院站● ̄ ̄○ ̄ ̄ ̄●海滨宾馆站 ̄ ̄ ̄○ ̄ ̄ ̄|"<cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"|||"<cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"啤酒厂站○○儿童公园站○市旅游总公司站"<cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"|||"<cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"俱乐部站○||"<cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"|广州|湾站霞湖|医院站"<cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<" ̄○ ̄○ ̄ ̄● ̄ ̄ ̄ ̄ ̄○ ̄ ̄ ̄ ̄ ̄ ̄● ̄ ̄○ ̄ ̄"<cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"广医附院站国贸站|建新东路站|霞山汽车运输总站"<cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"||"<cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"3线||"<cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<" ̄ ̄○ ̄ ̄○ ̄ ̄ ̄○ ̄○建设路站○海运集团公司站"<cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"世纪广场站人民大道湛江汽车南站|"<cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"中巴专线|1线"<cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<<"(●为换乘站点,○为普通站点)"<cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
cout<voidmain(){stringpath1[pathlen]={"农垦医院站","潜水运动学校站","海滨宾馆站","海上城市站","市旅游总公司站","霞湖医院站","海运集团公司站"};stringpath2[pathlen]={"东华站","湾桥站","农垦医院站","啤酒厂站","俱乐部站","广医附院站","国贸站","广州湾站","建新东路站","霞湖医院站","霞山汽车运输总站"};stringpath3[pa
voidmain()
stringpath3[pa
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2