酒店管理系统代码c语言版

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

oomNumber = 301+i;

memset(roomArray[i].nameOne,0,20);

memset(roomArray[i].nameTwo,0,20);

roomArray[i].sexOne = 0;

roomArray[i].sexTwo = 0;

roomArray[i].Count = 0;

}

}

void fun1() ount == 2)

{

continue;

}

else if(roomArray[i].Count == 1)

{

if(roomArray[i].sexOne != sex)

{

continue;

}

strcpy(roomArray[i].nameTwo,name);

roomArray[i].sexTwo = sex;

roomArray[i].Count++;

system("cls");

printf("客人已经成功入住,在房间%d",roomArray[i].roomNumber);

return;;

}

else

{

strcpy(roomArray[i].nameOne,name);

roomArray[i].sexOne = sex;

roomArray[i].Count++;

system("cls");

printf("客人已经成功入住,在房间%d",roomArray[i].roomNumber);

return;;

}

}

printf("无法入住,房间已经住满或者是没有适合的房间");

}

void fun2() ameOne,name) == 0)

{

memset(roomArray[i].nameOne,0,20);

roomArray[i].sexOne = 0;

roomArray[i].Count--;

system("cls");

printf("%s客人已经成功退房\n",name);

return;

}

if(strcmp(roomArray[i].nameTwo,name) == 0)

{

memset(roomArray[i].nameTwo,0,20);

roomArray[i].sexTwo = 0;

roomArray[i].Count--;

system("cls");

printf("%s客人已经成功退房\n",name);

return;

}

}

system("cls");

printf("没有名为%s的客人,请检查输入的正确性!\n",name); }

void fun3() 有房间入住信息显示\n");

printf(" 2.按照姓名查询\n"); printf(" 3.按照房号查询\n"); scanf("%d",&index);

if(index == 1)

{

for( i=0;i<5;i++)

{

printf("房间%d:",roomArray[i].roomNumber);

if(roomArray[i].Count == 0)

{

printf("没有客人入住\n");

}

else if(roomArray[i].Count == 1)

{

if(roomArray[i].sexTwo == 0)

{

printf("当前有1位客人-> 姓名%s,",roomArray[i].nameOne);

if(roomArray[i].sexOne == 1)

printf("性别:男");

else if(roomArray[i].sexOne == -1)

printf("性别:女");

printf("\n");

}

else if(roomArray[i].sexOne == 0)

{

printf("当前有1位客人-> 姓名%s,",roomArray[i].nameTwo);

if(roomArray[i].sexTwo == 1)

printf("性别:男");

else if(roomArray[i].sexTwo == -1)

printf("性别:女");

printf("\n");

}

}

else

{

ameOne,roomArray[i].sexOne,roomArray[i].nameTwo,roomArray[i].sexTwo);

printf("当前有2位客人-> 姓名%s,",roomArray[i].nameOne);

if(roomArray[i].sexOne == 1)

printf("性别:男,");

else if(roomArray[i].sexOne == -1)

printf("性别:女,");

printf("姓名:%s,",roomArray[i].nameTwo);

if(roomArray[i].sexTwo == 1)

printf("性别:男,");

else if(roomArray[i].sexOne == -1)

相关文档
最新文档