.
[l][room[i-1].t[0].mon-1])||(room[i-1].t[0].hour<0||room[i-1].t[0].hour>=24))
{printf(\您的入住时间输入有误,请按照格式重新输入:\
scanf(\om[i-1].t[0].date,&room[i-1].t[0].hour); l=judge_year(room[i-1].t[0].year); }
printf(\请输入您的押金数额:\scanf(\while(room[i-1].deposit<=0)
{printf(\您的押金数额输入有误,请您重新输入:\\n\scanf(\}
printf(\您是否确定您的信息:(1-是,2-否):\scanf(\while(k<1||k>2)
{printf(\您的选择输入有误,请您重新输入:\\n\scanf(\}
if(k==1)
{printf(\您已登记入住成功,祝您在本店住得愉快!\\n\\n\save(i); choice(); } else
check_in(); }
/*费用查询函数*/ void price()
{system(\清屏*/ system(\
printf(\费用查************************************\\n\int i; int j; int k;
int tab[2][12]={{31,28,31,30,31,30,31,31,30,31,30,31},
.
询.
{31,29,31,30,31,30,31,31,30,31,30,31}}; int day=0; int hr=0;
int total_hour; int total_day; long int price;
printf(\请输入您的房间号:\scanf(\while(i<1||i>80)
{printf(\您的房间号输入有误,请您重新输入:\ scanf(\ }
read(i);
while(room[i-1].flag==0) /*判断房间是否已有客人入住*/
{printf(\该房间无人入住,请重新输入您的房间号:\scanf(\read(i); }
printf(\请按所示格式输入当前时间(年-月-日-时,时为24小时制):\输入当前时间*/ shuru:
scanf(\om[i-1].t[1].date,&room[i-1].t[1].hour); j=judge_year(room[i-1].t[1].year);
while((room[i-1].t[1].year<=0)||(room[i-1].t[1].mon<=0||room[i-1].t[1].mon>12)||(room[i-1].t[1].date<=0||room[i-1].t[1].date>tab[j][room[i-1].t[1].mon-1])||(room[i-1].t[1].hour<0||room[i-1].t[1].hour>=24))
{printf(\您的入住时间输入有误,请按照格式重新输入:\
scanf(\om[i-1].t[1].date,&room[i-1].t[1].hour); j=judge_year(room[i-1].t[1].year); }
if(room[i-1].t[0].mon!=room[i-1].t[1].mon)
{for(k=room[i-1].t[0].mon+1;k . . day+=tab[j][room[i-1].t[0].mon-1]-room[i-1].t[0].date+room[i-1].t[1].date; } else {day+=room[i-1].t[1].date-room[i-1].t[0].date;} hr=room[i-1].t[1].hour-room[i-1].t[0].hour; if(room[i-1].flag==1) /*根据房间类型和计费方式计算费用*/ {if(hr<0) {total_hour=day*24-hr;} else {total_hour=day*24+hr;} if(i<=40) price=8*total_hour; else price=7*total_hour; } if(room[i-1].flag==2) {while(hr<0) {day=day-1;hr=hr+24;} if(hr<8) {total_day=day;} else {total_day=day+1;} if(i<=40) price=148*total_day; else price=128*total_day; } while(price<0) {printf(\您的时间输入有误,请重新输入:\goto shuru; } printf(\当前费用为:%ld元.\\n\\n\出当前费用*/ choice(); } . 输. /*结账退房函数*/ void fee() {system(\system(\ printf(\结账退房************************************\\n\int i; int j; int k; int tab[2][12]={{31,28,31,30,31,30,31,31,30,31,30,31}, {31,29,31,30,31,30,31,31,30,31,30,31}}; int day=0; int hr=0; int total_hour; int total_day; long int price; long int fee; printf(\请输入您的房间号:\scanf(\while(i<1||i>80) {printf(\您的房间号输入有误,请您重新输入:\ scanf(\ } read(i); while(room[i-1].flag==0) /*判断房间是否有客人入住*/ {printf(\该房间无人入住,请重新输入您的房间号:\scanf(\read(i); } printf(\请按所示格式输入当前时间(年-月-日-时,时为24小时制):\输入当前时间*/ shuru: scanf(\om[i-1].t[1].date,&room[i-1].t[1].hour); j=judge_year(room[i-1].t[1].year); while((room[i-1].t[1].year<=0)||(room[i-1].t[1].mon<=0||room[i-1].t[1].mon>12)||(room[i-1].t[1].date<=0||room[i-1].t[1].date>tab . . [j][room[i-1].t[1].mon-1])||(room[i-1].t[1].hour<0||room[i-1].t[1].hour>=24)) {printf(\您的入住时间输入有误,请按照格式重新输入:\ scanf(\om[i-1].t[1].date,&room[i-1].t[1].hour); j=judge_year(room[i-1].t[1].year); } if(room[i-1].t[0].mon!=room[i-1].t[1].mon) {for(k=room[i-1].t[0].mon+1;k day+=tab[j][room[i-1].t[0].mon-1]-room[i-1].t[0].date+room[i-1].t[1].date; } else {day+=room[i-1].t[1].date-room[i-1].t[0].date;} hr=room[i-1].t[1].hour-room[i-1].t[0].hour; if(room[i-1].flag==1) /*根据房间类型和计费方式计算费用*/ {if(hr<0) {total_hour=day*24-hr;} else {total_hour=day*24+hr;} if(i<=40) price=8*total_hour; else price=7*total_hour; } if(room[i-1].flag==2) {while(hr<0) {day=day-1;hr=hr+24;} if(hr<8) {total_day=day;} else {total_day=day+1;} if(i<=40) price=148*total_day; else .