|
|
@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
void availability() //查询房间入住情况函数
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int g,count=0;
|
|
|
|
|
|
|
|
for(g=0;g<100;g++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(z[g]==0)
|
|
|
|
|
|
|
|
++count;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
if(z[g]==1)
|
|
|
|
|
|
|
|
printf("\n正在使用的房间号:%d",g);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
printf("\n\n未使用的房间数:%d",count); //通过循环输出未使用的房间数
|
|
|
|
|
|
|
|
printf("\n\n");
|
|
|
|
|
|
|
|
printf("\n请输入需查询的房间号: "); //查询输入的房间号的信息,且输出该房间的相关信息
|
|
|
|
|
|
|
|
scanf("%d",&s);
|
|
|
|
|
|
|
|
while(s<0||s>100)
|
|
|
|
|
|
|
|
{printf(" *********************您输入的数字有误,请重新输入。********************\n");
|
|
|
|
|
|
|
|
scanf("%d",&s);}if(s==0) menu();
|
|
|
|
|
|
|
|
if(z[s]==1)
|
|
|
|
|
|
|
|
{printf("姓名:%s",room[s].name);
|
|
|
|
|
|
|
|
printf("\n性别(其中:1表示男,2表示女):%d",room[s].sex);
|
|
|
|
|
|
|
|
printf("\n年龄:%d",room[s].age);
|
|
|
|
|
|
|
|
printf("\n身份证号:%s",room[s].ID_card);
|
|
|
|
|
|
|
|
printf("\n年:%d",room[s].date.year);
|
|
|
|
|
|
|
|
printf(" 月:%d",room[s].date.month);
|
|
|
|
|
|
|
|
printf(" 日:%d",room[s].date.day);
|
|
|
|
|
|
|
|
printf("\n房间号:%d",room[s].room_ID);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
printf("该房间未被使用!");
|
|
|
|
|
|
|
|
menu();
|
|
|
|
|
|
|
|
save(); //调用保存函数
|
|
|
|
|
|
|
|
}
|