From 7b322ed7f290a71ede655eb3ef4336f60457bbf2 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:41:55 +0800 Subject: [PATCH] C3 --- xitong.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/xitong.c b/xitong.c index 714e489..fec9166 100644 --- a/xitong.c +++ b/xitong.c @@ -148,4 +148,83 @@ void printff(){ 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"); } \ No newline at end of file