struct {
char out;
char name[20];
char srccity[20];
char tarcity[20];
}Node;
//做一个链表,把游客信息存进去,out = 0;
输出始发城市阶段,遍历链表
while(pt != NULL)
{
if(pt->out != 0){pt = pt->next;continue;}
list = pt;
printf("%s :",list->srccity);
while(list != NULL)
{
if(list->out == 0 && 0 == strcmp(list->srccity,pt->srccity))
{
list->out=1;
printf(" %s",list->name);
}
list = list->next;
}
putchar('\n');
pt = pt->next;
}