地铁路线——最短路径
今天对地铁查询系统如何做进行了讨论,知道如何在数据库中对数据进行存储,在数据库中建立两个表,一个表为站点表,表内为地铁的线路、姓名、序号、唯一标识,另一个表为中转表,表内存储中转点的信息,中转点的名称、第一个线路、第二个线路;起点到终点的最短线路用深度优先遍历。
`
<head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> * { border-radius: 10px; } hr { height: 1px; background-color: cornsilk; }h3 {
text-align: center;
color: cornsilk;
font-size: 30px;
}
.title {
float: left;
}
li {
list-style: none;
background-color: rgb(166, 183, 216);
width: 150px;
height: 50px;
font-size: 20px;
color: floralwhite;
line-height: 50px;
margin-left: -40px;
border-radius: 10px;
text-align: center;
}
.choose {
background-color: rgb(132, 195, 216);
/* border:1px solid rgb(99, 99, 206) ;添加边框以及颜色*/
}
.input1 {
min-width: 500px;
min-height: 55px;
/* top: 50%;/处于居中的位置/
background-color: cornsilk;
/* position: absolute;/input表单处于居中的位置/
font-size: 20px;
color: darkgreen;
/* margin-top: 50px;
/调整距离让那个input表单放在合适的位置/
margin-left: 100px;
border: none;
border-radius: 10px;
}
select {
min-width: 100px;
min-height: 55px;
background-color: cornsilk;
font-size: 20px;
color: darkgreen;
margin-top: 50px;
/调整距离让那个input表单放在合适的位置/
margin-left: 20px;
border-radius: 10px;
/将边框改成圆角/
}
.nav {
background-color:rgb(166, 183, 216);
box-sizing: border-box;
width: 1300px;
height: 600px;
margin: 100px auto;
}
.content {
background-color: rgb(132, 195, 216);
height: 600px;
}
/下面是图中的额外按钮部分/
.button1 {
min-width: 55px;
min-height: 55px;
margin-left: 40px;
margin-top: 50px;
background-image: url(images/th.jfif);
background-size: 100%;
/调整图片的大小符合我们的尺寸/
font-size: 20px;
color: darkgreen;
border: none;
/边框为0/
border-radius: 10px;
}
.all {
min-width: 55px;
min-height: 70px;
/* margin-top: 50px;*/
background-size: 80%;
/调整图片的大小符合我们的尺寸/
border: none;
/边框为0/
border-radius: 10px;
background-repeat: no-repeat;
background-position: top center;
color: darkgreen;
font-size: 16px;
height: 55px;
/设置其中的文字靠下/
line-height: 120px;
}
.map {
background-image: url(images/map.jfif);
margin-top: 50px;
margin-left: 300px;
}
.calinder {
min-width: 77px;
background-image: url(images/calinder.jfif);
margin-left: 210px;
}
.tolelt {
background-image: url(images/tolelt.jfif);
margin-left: 200px;
}
线路查询

浙公网安备 33010602011771号