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.
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#define MAX 1000
|
|
|
|
typedef struct node {
|
|
|
|
char a[100];
|
|
|
|
struct node* next;
|
|
|
|
}edgenode;
|
|
|
|
typedef struct {
|
|
|
|
char name[100];
|
|
|
|
edgenode* firstnode;
|
|
|
|
}vexnode;
|
|
|
|
typedef struct {
|
|
|
|
vexnode adjust[7];
|
|
|
|
int e, n;
|
|
|
|
}
|
|
|
|
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");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
creatnode();
|
|
|
|
createlist();
|
|
|
|
int n=10;
|
|
|
|
printf("正在初始化数据,请稍候!\n");
|
|
|
|
//proc();
|
|
|
|
printf("欢迎使用本系统!\n");
|
|
|
|
while(n){
|
|
|
|
printf("欢迎来到上海市地铁交通服务平台!\n");
|
|
|
|
printf(" 最佳出行线路推荐\n");
|
|
|
|
printf(" 退出系统!\n");
|
|
|
|
printf("请输入!\n");
|
|
|
|
scanf("%d",&n);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|