#include
//时间函数的定义
struct tm *localtime(const time_t * timep);
//时间的初始化
char *wday[]={\星期天\星期一\星期二\星期三\星期四\星期五\星期六\ time_t timep; struct tm *now; struct tm *after; // time(&timep);
//酒店房间的定义 struct house { char house_number[10]; char house_shape[2]; float house_price; int sum_person; // struct house *next; }h[10]= { {\ {\ {\ {\ {\ {\ {\ {\ {\ {\};
struct guest { //住客姓名、性别、年龄、身份、身份证号码,房号,床号,入住日期、入住时间、离店日期、离店时间。 char name[10]; char sex[6]; int age; char identify[18]; char identify_number[18]; char room[10]; char bed[10]; // Date guest_in; // Date guest_out; struct tm *p; struct tm *q; struct guest *next; };
void first_inquiry() { int i=0; int n=0; char ch[2]=\ for (i=0;i<10;i++) { if ((strcmp(h[i].house_shape,ch)==0)) { if (h[i].sum_person==0) { printf(\ } } } }
void second_inquiry() { { int i=0; int n=0; char ch[2]=\
for (i=0;i<10;i++) { if ((strcmp(h[i].house_shape,ch)==0)) { if (h[i].sum_person==0) { printf(\ } } } } }
void third_inquiry() { int i=0; int n=0; char ch[2]=\ for (i=0;i<10;i++) { if ((strcmp(h[i].house_shape,ch)==0)) { if (h[i].sum_person==0) { printf(\ } } } }
void lookfor_house_is_Null() { int your_choice; do { printf(\你要查询:1.单人间 2.双人间 3.多人间 4.退出:\\n\ printf(\输入你的选择:\\t\
scanf(\ switch(your_choice) { case 1: printf(\单人间的空余房间:\\t\ first_inquiry(); printf(\ break; case 2: printf(\双人房的空余房间:\\t\ second_inquiry(); printf(\ break; case 3: printf(\多人间的空余房间:\\t\ third_inquiry(); printf(\ break; case 4: // exit(1); break; } } while(your_choice!=4); printf(\ printf(\ }
void add_house_sum_number(char str[10]) { int i=0; for (i=0;i<10;i++) { if ((strcmp(h[i].house_number,str)==0)) {
h[i].sum_person=1; } else { continue; } } }
typedef struct guest * link_guest;
//创建
link_guest create_guest(void) { link_guest head=(link_guest)malloc(sizeof(struct guest)); if (head!=NULL) { head->next=NULL; } else { printf(\ } return head; }
bool is_null_guest(link_guest head) { if(head->next==NULL) { return true; } return false; }
//写个函数判断一下 当输入住客的房号时,是否还有个这个房间 bool is_null_this_house(char str[10]) { int i=0;