- 2
- 0
- 约4.67千字
- 约 7页
- 2019-09-14 发布于广东
- 举报
#include stdio.h
#include stdlib.h
#include string.h struct info
{
char time[31];
char name[31];
char doing[81J;
struct poi_info
{
struct info y;
struct poi」nfo *next;//指针域,存放后一节点地址
};
〃按顺序录入事件,创建单链表
void input(struct poi_info * head)
{
int sfjx=l;
struct poi_info *q,*p;
q=head;
while(q-next !=NULL)
q=q-next;
while(sfjx!=O)
{
p=(struct poi_info *)malloc(sizeof(struct poi_info));
if(p==NULL)
printf(u\n空间分配不成功,无法进行记录! \nH);
else
{
printf(H\n请输入要记录的时间(格式:年.月.日.时 例如2011.6.1.9),地名, 事件:\nM);
scanf(”%s%s%s,p ?y.time,p ? y.name,p ? y.doing);
q-next=p;
q=p;
}
printf(n\n是否继续(0—结束 其它一继续):”);
scanf(H%du,
原创力文档

文档评论(0)