From e617cbf64b3713d07da4eb83c52f7a6bc27ad752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E4=BD=B3=E6=85=A7?= <1608111480@qq.com> Date: Mon, 3 Jul 2023 13:31:49 +0800 Subject: [PATCH] 1-46 --- 城市地铁导航系统.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/城市地铁导航系统.c b/城市地铁导航系统.c index d496577..84e1286 100644 --- a/城市地铁导航系统.c +++ b/城市地铁导航系统.c @@ -13,6 +13,36 @@ typedef struct { vexnode adjust[7]; int e, n; +}list; + list nm; + void creatnode() {//对节点进行初始化 + nm.e = 7;//边数 + nm.n = 7;//站点数 + strcpy(nm.adjust[0].name, "肇嘉浜路"); + strcpy(nm.adjust[1].name, "东安路"); + strcpy(nm.adjust[2].name, "上海体育场"); + strcpy(nm.adjust[3].name, "嘉善路"); + strcpy(nm.adjust[4].name, "大木桥路"); + strcpy(nm.adjust[5].name, "徐家汇"); + strcpy(nm.adjust[6].name, "上海体育馆"); + int i; + for (i = 0; i < nm.n; i++) { + nm.adjust[i].firstnode = NULL; + } +} + void createlist() { + edgenode *p; + //下面是肇嘉浜路的邻接表 + //... + //下面是上海体育馆的邻接表 + //... +} + int cont[100][100];//邻接矩阵 + void aaa(){ + int i,j; + for(i=0;i