You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ddd/城市地铁导航系统.c

44 lines
734 B

1 year ago
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
1 year ago
#define MAX 1000
typedef struct node {
1 year ago
char a[100];
struct node* next;
}edgenode;
1 year ago
typedef struct {
1 year ago
char name[100];
1 year ago
edgenode* firstnode;
1 year ago
}vexnode;
typedef struct {
1 year ago
vexnode adjust[7];
1 year ago
int e, n;
1 year ago
}
void createjz(){//创建邻接矩阵函数
edgenode *p;
aaa();
int i;
for(i=0;i<nm.n;i++){
p=nm.adjust[i].firstnode;
while(p!=NULL){
int h;
for(h=0;h<nm.n;h++)
if(!strcmp(p->a,nm.adjust[h].name)) break;
cont[i][h]=1;
p=p->next;
}
}
}
void print() {
edgenode* p;
int i;
for(i=0;i<nm.n;i++){
printf("[%s]",nm.adjust[i].name);
p=nm.adjust[i].firstnode;
while(p!=NULL){
printf("-->[%s]",p->a);
p=p->next;
}
printf("\n");
}
1 year ago
}