From 3cc4bfdc2676cc20d48ab67db67bf043db39441e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=89=BA=E5=93=B2?= <446062334@qq.com> Date: Sat, 8 Jul 2023 20:59:14 +0800 Subject: [PATCH] hhhhhhh --- README.md | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 70c6f53..581b47e 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,85 @@ void printff(){ ``` ##C3:创建邻接矩阵、打印邻接矩阵和执行Dijkstra算法{152-230} ``` -代码: +void createjz(){//创建邻接矩阵函数 + edgenode *p; + aaa(); + int i; + for(i=0;ia,nm.adjust[h].name)) break; + cont[i][h]=1; + p=p->next; + } + } +} + void print() { + edgenode* p; + int i; + for(i=0;i[%s]",p->a); + p=p->next; + } + printf("\n"); + } +} + int num2=0; + int money=0; + void Dijkstra(int v1,int v2){ + int dist[MAX],s[MAX],path[MAX];//s判断v1是否已经判断最短路径,path前驱 + int min,i,j,u,pre; + for(i=0;i",nm.adjust[pre].name); + money++; + pre=path[pre]; + } + printf("%s",nm.adjust[pre].name); + } + else printf("路径不存在!"); + } + } + printf("\n"); +} ``` ##C4:打印菜单,实现功能{231-312} ```