From 1234999732868a114d6a7ba816afef7d3f596954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=89=BA=E5=93=B2?= <446062334@qq.com> Date: Mon, 3 Jul 2023 14:57:47 +0800 Subject: [PATCH] fdg --- 城市地铁导航系统.c | 74 +++++++++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 4 deletions(-) diff --git a/城市地铁导航系统.c b/城市地铁导航系统.c index 84e1286..a60cec9 100644 --- a/城市地铁导航系统.c +++ b/城市地铁导航系统.c @@ -32,10 +32,76 @@ } void createlist() { edgenode *p; - //下面是肇嘉浜路的邻接表 - //... - //下面是上海体育馆的邻接表 - //... + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "东安路"); + p->next = nm.adjust[0].firstnode; + nm.adjust[0].firstnode = p; + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "嘉善路"); + p->next = nm.adjust[0].firstnode; + nm.adjust[0].firstnode = p; + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "徐家汇"); + p->next = nm.adjust[0].firstnode; + nm.adjust[0].firstnode = p; + //下面是东安路的邻接表 + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "肇嘉浜路"); + p->next = nm.adjust[1].firstnode; + nm.adjust[1].firstnode = p; + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "上海体育场"); + p->next = nm.adjust[1].firstnode; + nm.adjust[1].firstnode = p; + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "大木桥路"); + p->next = nm.adjust[1].firstnode; + nm.adjust[1].firstnode = p; + //下面是上海体育场的邻接表 + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "东安路"); + p->next = nm.adjust[2].firstnode; + nm.adjust[2].firstnode = p; + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "上海体育馆"); + p->next = nm.adjust[2].firstnode; + nm.adjust[2].firstnode = p; + //下面是嘉善路的邻接表 + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "大木桥路"); + p->next = nm.adjust[3].firstnode; + nm.adjust[3].firstnode = p; + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "肇嘉浜路"); + p->next = nm.adjust[3].firstnode; + nm.adjust[3].firstnode = p; + //下面是大木桥路 + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "东安路"); + p->next = nm.adjust[4].firstnode; + nm.adjust[4].firstnode = p; + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "嘉善路"); + p->next = nm.adjust[4].firstnode; + nm.adjust[4].firstnode = p; + //下面是徐家汇 + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "肇嘉浜路"); + p->next = nm.adjust[5].firstnode; + nm.adjust[5].firstnode = p; + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "上海体育馆"); + p->next = nm.adjust[5].firstnode; + nm.adjust[5].firstnode = p; + //下面是上海体育馆 + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "徐家汇"); + p->next = nm.adjust[6].firstnode; + nm.adjust[6].firstnode = p; + p = (edgenode*)malloc(sizeof(edgenode)); + strcpy(p->a, "上海体育场"); + p->next = nm.adjust[5].firstnode; + nm.adjust[6].firstnode = p; } int cont[100][100];//邻接矩阵 void aaa(){