//通過站站查找
struct train *seek(struct train *head,char zhan[20])
{
struct train *p1,*p2;
if (head==NULL) {printf("\nlist null!\n");goto end;}
p1=head;
while(strcmp(zhan,p1->zhan)!=0&&p1->next!=NULL)
{p2=p1;p1=p1->next;}
if(strcmp(zhan,p1->zhan)==0)
{
printf("列車車次信息為:\n");
printf("※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n");
printf("車次 始發站 站點 終點站 發車時間 到站時間 ");
printf("%s %s %s %s %s %d\n",p1->che,p1->shi,p1->zhong,p1->fa,p1->dao);
printf("※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n");
}
else
printf("輸入錯誤!\n");
end:
return(head);
}
我程式已經做的差不多了,但不知道怎麼才能實現站站查詢,求高手出手相助下,感激不盡!!!