广州地铁线路查询程序C语言,c语言广州地铁系统报错,帮帮忙看一看哈?

#include

#include

#include

#include //conio是控制台输入输出,比如getch()函数

/*定义地铁信息链表的结点结构*/

typedef struct stat

#include

#include

#include

#include //conio是控制台输入输出,比如getch()函数

/*定义地铁信息链表的结点结构*/

typedef struct station

{

char stopname[30]; /*站点*/

int m; //1或者0

struct station *next;

};

/*定义存储地铁信息的结构体*/

typedef struct NODE

{

char starttime[10];/*首班车时间*/

char finaltime[10];/*末班车时间*/

int stopnum;/*站数*/

struct station *next;

};

void stationinfo()

{

NODE *head1,*head2,*head3,*head4,*head5,*head6,*p,*q; //定义6条线路及两个指针

int i;

head1=q=(NODE *)malloc(sizeof(NODE)); //申请头结点,第一个节点储存首班车、末班车,站数的信息

q->next=NULL;

printf("请输入一号线的首班车时间");

scanf("%s",&NODE.starttime);

printf("请输入一号线的末班车时间");

scanf("%s",&NODE.finaltime);

printf("请输入一号线的站数");

scanf("%d",&NODE.stopnum);

q->next=p; //第二个节点开始储存站点的名字,以及确定是不是转乘站

q=p;

for(i=0;inext=NULL;

p=head->next;

}

void printfinfo()

{

printf("这条线路的信息:");

printf("%s %s %d",NODE.starttime,NODE.finaltime,NODE.stopnum);

p=p->next;

while(p!=NULL)

{

printf("%s ",station.stopname);

p=p->next;

}

}

展开

全部

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值