c语言数据结构设计酒店信息系统链表怎么往里面添加元素
#include<stdio.h>#include<stdlib.h>
#include<conio.h>
#include<string.h>
#define TITLE 45
struct customer
{
int bednum;
char name[20];
// int age;
char sex;
int level;
int year;
int month;
int day;
};
typedef struct CUList
{
struct customer CUS;
struct CUList *next;
} CUList,* CULIST ;
void add(CULIST *head)
{
int i,j,k,s,c,b,s1;
//link *p;
CULIST a = (CUList*)malloc(sizeof(struct CUList));
head
printf("请输入顾客的姓名");
scanf("%s",(a->CUS).name);
printf("请输入顾客的需求(d订房或t退房)");
//scanf("%s",s);
gets(s);
//fflush(stdin);
switch(s)
{
case'd':
case 'D':
printf("你的订房需求(钟点房b或普通房c)");
scanf("%s",s1);
//if(strcmp(s1,'b'))
{
printf("钟点房房号从1到10");
//scanf("%d",)
}
break;
case't':
case 'T':
printf("你的房间号");
break;
}
}
int main()
{
//menu();
CULIST head = NULL;
add(&head);
}