You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

405 lines
14 KiB

6 years ago
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h> //<2F><>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>Ҫ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD><DAB1>ļ<EFBFBD><C4BC><EFBFBD>
#include <stdlib.h> //exit()<29><><EFBFBD><EFBFBD><EFBFBD>Ͱ<EFBFBD><CDB0><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4>ļ<EFBFBD><C4BC><EFBFBD>
#include <conio.h>
#define isPrime(year) ((year%4==0&&year%100!=0)||(year%400==0))
int z[100]={0};
int s,j;
FILE *fp;
void check_in(); //<2F><><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD><C7BC><EFBFBD>ס<EFBFBD><D7A1><EFBFBD><EFBFBD>
void availability(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ס<EFBFBD><D7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void fate_days(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>ס<EFBFBD>޵ķ<DEB5><C4B7><EFBFBD>
void fate_hours(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯʱ<D1AF><CAB1>ס<EFBFBD>޵ķ<DEB5><C4B7><EFBFBD>
void check_out_days(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ס<EFBFBD>޵ķ<DEB5><C4B7><EFBFBD>
void check_out_hours(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ס<EFBFBD>޵ķ<DEB5><C4B7><EFBFBD>
void modificate(); //<2F><><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD><DEB8><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
void modificate_person(); //<2F><><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD><DEB8><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5>޸Ŀͻ<C4BF><CDBB><EFBFBD>Ϣ
void modificate_accommodation(); //<2F><><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD><DEB8><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5>޸<EFBFBD>ס<EFBFBD><D7A1><EFBFBD><EFBFBD>Ϣ
void save(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E6BAAF>
void menu(); //<2F><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>
void days(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ס<EFBFBD><D7A1><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void hours(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ס<EFBFBD><D7A1><EFBFBD><EFBFBD>ΪСʱ<D0A1><CAB1><EFBFBD><EFBFBD>
int date1Diff(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEBAAF>
struct date1
{
int year;
int month;
int day;
};
struct Date
{int year;
int month;
int day;
int hour;
int minute;
}date; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD>
struct room
{
int room_ID; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int kind; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼䣬˫<E4A3AC>˼䣬<CBBC><E4A3AC><EFBFBD>˼䣬VIP<49>׷<EFBFBD><D7B7><EFBFBD>
char name[20]; //<2F>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>
int age; //<2F>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>
int sex; //<2F>ͻ<EFBFBD><CDBB>Ա<EFBFBD>
char ID_card[20]; //<2F>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>
int day_money; //<2F><><EFBFBD><EFBFBD><EFBFBD>շѼ۸<D1BC>
int hour_money; //<2F><>Сʱ<D0A1>շѼ۸<D1BC>
int count; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
struct Date date;
}room[100];
int main()
{
printf("\n");
menu(); //<2F><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
save();
return 0;
}
void menu()
{
int n;
do
{
printf("\n");
printf(" \t ******************<2A><>ӭ<EFBFBD><D3AD>ס<EFBFBD>Ƶ<EFBFBD>***************** \n");
printf("\n *********************<2A>˵<EFBFBD>********************");
printf("\n******* 1.<2E>Ǽ<EFBFBD><C7BC><EFBFBD>ס \t *******\n");
printf("******* 2.<2E><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ס<EFBFBD><D7A1><EFBFBD><EFBFBD> \t *******\n");
printf("******* 3.<2E><>ѯ<EFBFBD><D1AF>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>) \t *******\n");
printf("******* 4.<2E><>ѯ<EFBFBD><D1AF>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><><CAB1>) \t *******\n");
printf("******* 5.<2E><><EFBFBD>˵<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>) \t *******\n");
printf("******* 6.<2E><><EFBFBD>˵<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><><CAB1>) \t *******\n");
printf("******* 7.<2E>˳<EFBFBD> \t *******");
printf(" *********************<2A>˵<EFBFBD>********************\n"); //<2F><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><C3B2><EFBFBD>Ա<EFBFBD>ܹ<EFBFBD><DCB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>еIJ<D0B5><C4B2><EFBFBD>
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD>򷵻ز˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>");
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
scanf("%d",&n);
while(n<1||n>7)
{printf(" *********************<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롣********************\n");
scanf("%d",&n);}
switch(n)
{
case 1:check_in();break; //<2F><><EFBFBD>õǼ<C3B5><C7BC><EFBFBD>ס<EFBFBD><D7A1><EFBFBD><EFBFBD>
case 2:availability();break; //<2F><><EFBFBD>ò<EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ס<EFBFBD><D7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
case 3:fate_days();break; //<2F><><EFBFBD>ò<EFBFBD>ѯ<EFBFBD><D1AF>ǰ<EFBFBD><C7B0><EFBFBD>÷<EFBFBD><C3B7>ú<EFBFBD><C3BA><EFBFBD>
case 4:fate_hours();break; //<2F><><EFBFBD>ò<EFBFBD>ѯ<EFBFBD><D1AF>ǰʱ<C7B0>÷<EFBFBD><C3B7>ú<EFBFBD><C3BA><EFBFBD>
case 5:check_out_days();break; //<2F><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><C3B7>ú<EFBFBD><C3BA><EFBFBD>
case 6:check_out_hours();break; //<2F><><EFBFBD>ý<EFBFBD><C3BD>˵<EFBFBD>ǰʱ<C7B0>÷<EFBFBD><C3B7>ú<EFBFBD><C3BA><EFBFBD>
case 7:exit(0); //<2F>˳<EFBFBD>
}
}while(n!=7);
scanf("%d",&n);
}
void check_in() // <20>ǼǺ<C7BC><C7BA><EFBFBD>
{
int op,way,po,i,num;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%d", &num); while(num<0||num>100)
{printf(" *********************<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롣********************\n");
scanf("%d",&num);}
if(num==0) menu();
for (i=1;i<=num;++i) {
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ:\n");
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d<><64><EFBFBD>ţ<EFBFBD>(1<>ŵ<EFBFBD>100<30><30>֮<EFBFBD><D6AE>)",i);
scanf("%d", &j);if(j==0) menu();
room[j].room_ID = j;
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
scanf("%d", &room[j].age);if(room[j].age==0) menu();
while (j<0||j>100)
{
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
printf("\n<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>ס<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>(1<><31>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>Ʒѣ<C6B7>2<EFBFBD><32>ʾ<EFBFBD><CABE>Сʱ<D0A1>Ʒ<EFBFBD>)\n\t *****ע<><EFBFBD><E2A3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>סʱ<D7A1><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><CFA3><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD>*****");
scanf("%d", &way);if(way==0) menu();
printf("\n<EFBFBD><EFBFBD>סʱ<EFBFBD><EFBFBD>Ϊ(<28><>):");
scanf("%d", &room[j].date.year);if(room[j].date.year==0) menu();
printf("\n<EFBFBD><EFBFBD>סʱ<EFBFBD><EFBFBD>Ϊ(<28><>):");
scanf("%d", &room[j].date.month);if(room[j].date.month==0) menu();
printf("\n<EFBFBD><EFBFBD>סʱ<EFBFBD><EFBFBD>Ϊ(<28><>):");
scanf("%d", &room[j].date.day);if(room[j].date.day==0) menu();
if (way == 1)
{
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ࣺ[1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD>(200Ԫ/<2F><>)<29><>2<EFBFBD><32><EFBFBD><EFBFBD>˫<EFBFBD>˼<EFBFBD>(390Ԫ/<2F><>)<29><>3<EFBFBD><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD>(475Ԫ/<2F><>)<29><>4<EFBFBD><34><EFBFBD><EFBFBD>VIP<49>׷<EFBFBD>(650Ԫ/<2F><>)]");
scanf("%d", &op);if(op==0) menu();
}
if (way == 2)
{
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ࣺ[1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD>(10Ԫ/Сʱ)<29><>2<EFBFBD><32><EFBFBD><EFBFBD>˫<EFBFBD>˼<EFBFBD>(19Ԫ/Сʱ)<29><>3<EFBFBD><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD>(27Ԫ/Сʱ)<29><>4<EFBFBD><34><EFBFBD><EFBFBD>VIP<49>׷<EFBFBD>(45Ԫ/Сʱ)]");
scanf("%d", &po);if(po==0) menu();
printf("\n<EFBFBD><EFBFBD>סʱ<EFBFBD><EFBFBD>Ϊ(Сʱ):");
scanf("%d", &room[j].date.hour);if(room[j].date.hour==0) menu();
printf("\n<EFBFBD><EFBFBD>סʱ<EFBFBD><EFBFBD>Ϊ(<28><><EFBFBD><EFBFBD>):");
scanf("%d", &room[j].date.minute);if(room[j].date.minute==0) menu();
}
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%s", &room[j].name);if(room[j].name==0) menu();
printf("\n<EFBFBD>Ա<EFBFBD>(<28><><EFBFBD>У<EFBFBD>1<EFBFBD><31>ʾ<EFBFBD>У<EFBFBD>2<EFBFBD><32>ʾŮ!):");
scanf("%d", &room[j].sex);if(room[j].sex==0) menu();
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD>ţ<EFBFBD>");
scanf("%s", &room[j].ID_card);if(room[j].ID_card==0) menu();
z[j] = 1; //<2F><><EFBFBD><EFBFBD>ʹ<EFBFBD>õķ<C3B5><C4B7><EFBFBD>Ϊ1
save();
}
menu();
}
void availability() //<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ס<EFBFBD><D7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
int g,count=0;
for(g=0;g<100;g++)
{
if(z[g]==0)
++count;
else
if(z[g]==1)
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>õķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%d",g);
}
printf("\n\nδʹ<EFBFBD>õķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%d",count); //ͨ<><CDA8>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δʹ<CEB4>õķ<C3B5><C4B7><EFBFBD><EFBFBD><EFBFBD>
printf("\n\n");
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: "); //<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><C3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
scanf("%d",&s);
while(s<0||s>100)
{printf(" *********************<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롣********************\n");
scanf("%d",&s);}if(s==0) menu();
if(z[s]==1)
{printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%s",room[s].name);
printf("\n<EFBFBD>Ա<EFBFBD>(<28><><EFBFBD>У<EFBFBD>1<EFBFBD><31>ʾ<EFBFBD>У<EFBFBD>2<EFBFBD><32>ʾŮ):%d",room[s].sex);
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%d",room[s].age);
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>:%s",room[s].ID_card);
printf("\n<EFBFBD><EFBFBD>:%d",room[s].date.year);
printf(" <20><>:%d",room[s].date.month);
printf(" <20><>:%d",room[s].date.day);
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%d",room[s].room_ID);
}
else
printf("<EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>!");
menu();
save(); //<2F><><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD><E6BAAF>
}
void hours()
{
int nu,numb;
int hour1,minute1;
int hour2,minute2;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>סʱ<EFBFBD>Сʱ,<2C><><EFBFBD>ӣ<EFBFBD>");
scanf("%d,%d",&hour1,&minute1);if(hour1==0||minute1==0) menu();
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD>ʱ<EFBFBD>Сʱ,<2C><><EFBFBD>ӣ<EFBFBD>");
scanf("%d,%d",&hour2,&minute2);if(hour2==0||minute2==0) menu();
int t,t1,t2,o,q;
t1=hour1*60+minute1;
t2=hour2*60+minute2;
t=t2-t1;
o=t/60;
q=t%60;
if(q!=0)
o=o+1;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ס<EFBFBD><EFBFBD>СʱΪ%dСʱ",o);
printf("\n<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼䣬2<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˫<EFBFBD>˼䣬3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼䣬4<EFBFBD><EFBFBD><EFBFBD><EFBFBD>VIP<EFBFBD>׷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ");
scanf("%d",&nu);if(nu==0) menu();
printf("\n<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>׷<EFBFBD><EFBFBD><EFBFBD> ");
scanf("%d",&numb);
while(numb<1||numb>7)
{printf(" *********************<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롣********************\n");
scanf("%d",&numb);} if(numb==0) menu();
switch(nu)
{
case 1:printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ %d Ԫ",10*numb*o);break;
case 2:printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ %d Ԫ",19*numb*o);break;
case 3:printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ %d Ԫ",27*numb*o);break;
case 4:printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ %d Ԫ",45*numb*o);break;
}
}
int date1Diff(struct date1 mindate,struct date1 maxdate)
{
int Days=0,j,flag;
const int primeMonth[][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}};
/************************************************************************/
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD><DABA><EFBFBD>,<2C><>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD>mindate,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD>maxdate */
/************************************************************************/
struct date1 tmp;
if ((mindate.year>maxdate.year)|| (mindate.year==maxdate.year&&mindate.month>maxdate.month)||(mindate.year==maxdate.year&&mindate.month==maxdate.month&&mindate.day>maxdate.day))
{
tmp=mindate;
mindate=maxdate;
maxdate=tmp;
}
/************************************************************************/
/* <20><>mindate.year<61><72>ʼ<EFBFBD>ۼӵ<DBBC>maxdate.year */
/************************************************************************/
for(j=mindate.year;j<maxdate.year;++j)
Days+=isPrime(j)?366:365; //<2F><><EFBFBD><EFBFBD>maxdate.year<61><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>flag=1,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>primeMonth[1][12]
flag=isPrime(maxdate.year); //<2F><><EFBFBD><EFBFBD>maxdate.month<74><68>1<EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>
for (j=1;j<maxdate.month;j++)
Days+=primeMonth[flag][j-1]; //<2F><>ȥmindate.month<74><68>1<EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>
flag=isPrime(maxdate.year);
for (j=1;j<mindate.month;j++)
Days-=primeMonth[flag][j-1];
Days=Days+maxdate.day-mindate.day;
return Days;
}
void days()
{
int mun,un; // int isPrime(int year);
int date1Diff(struct date1 mindate,struct date1 maxdate);
struct date1 mindate,maxdate;
int Days;
printf("\t\t ***<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>벻Ҫ<EBB2BB><D2AA>0<EFBFBD><30><EFBFBD><EFBFBD>λ***");
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ס<EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD>£<EFBFBD><EFBFBD>գ<EFBFBD>:");
scanf("%i,%i,%i",&mindate.year,&mindate.month,&mindate.day);if(mindate.year==0||mindate.month==0||mindate.day==0) menu();
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD>£<EFBFBD><EFBFBD>գ<EFBFBD>:");
scanf("%i,%i,%i",&maxdate.year,&maxdate.month,&maxdate.day);if(maxdate.year==0||maxdate.month==0||maxdate.day==0) menu();
Days=date1Diff(mindate,maxdate);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ס<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ:%d\n",Days);
printf("\n<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼䣬2<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˫<EFBFBD>˼䣬3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼䣬4<EFBFBD><EFBFBD><EFBFBD><EFBFBD>VIP<EFBFBD>׷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ");
scanf("%d",&un);if(un==0) menu();
printf("\n<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>׷<EFBFBD><EFBFBD><EFBFBD> ");
scanf("%d",&mun); if(mun==0) menu();
switch(un)
{
case 1:printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ %d Ԫ",200*mun*Days);break;
case 2:printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ %d Ԫ",290*mun*Days);break;
case 3:printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ %d Ԫ",475*mun*Days);break;
case 4:printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ %d Ԫ",650*mun*Days);break;
}
}
void fate_days()
{
days();
menu();
}
void fate_hours()
{
hours();
menu();
}
void check_out_days()
{
int Mun=0, Un,i; // int isPrime(int year);
int date1Diff(struct date1 mindate, struct date1 maxdate);
struct date1 mindate, maxdate;
int Days;
int roomId;
int roomNum;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뷿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%i", &roomNum);if(roomNum==0) menu();
for (i = 1; i <= roomNum; ++i) {
while (1) {
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d<><64><EFBFBD>ţ<EFBFBD>(1<>ŵ<EFBFBD>100<30><30>֮<EFBFBD><D6AE>)",i);
scanf("%i", &roomId);if(roomId==0) menu();
if (roomId < 0 || roomId >= 100) {
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
continue;
}
else
break;
}
printf("\t\t ***<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>벻Ҫ<EBB2BB><D2AA>0<EFBFBD><30><EFBFBD><EFBFBD>λ***");
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ס<EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD>£<EFBFBD><EFBFBD>գ<EFBFBD>:");
scanf("%i,%i,%i", &mindate.year, &mindate.month, &mindate.day);if(mindate.year==0||mindate.month==0||mindate.day==0) menu();
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD>£<EFBFBD><EFBFBD>գ<EFBFBD>:");
scanf("%i,%i,%i", &maxdate.year, &maxdate.month, &maxdate.day);if(maxdate.year==0||maxdate.month==0||maxdate.day==0) menu();
Days = date1Diff(mindate, maxdate);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ס<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ:%d\n", Days);
printf("\n<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼䣬2<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˫<EFBFBD>˼䣬3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼䣬4<EFBFBD><EFBFBD><EFBFBD><EFBFBD>VIP<EFBFBD>׷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ");
scanf("%d", &Un);if(Un==0) menu();
switch (Un)
{
case 1:Mun+=(200*Days); break;
case 2:Mun += (290 * Days); break;
case 3:Mun+=(475*Days); break;
case 4:Mun += (650 * Days); break;
}
z[roomId] = 0;
memset(room + roomId, 0, sizeof(room));
}
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d Ԫ", Mun);
}
void check_out_hours()
{
int Nu, Numb = 0,i;
int hour1,minute1;
int hour2,minute2;
int roomId;
int roomNum;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뷿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%i", &roomNum);if(roomNum==0) menu();
for (i = 1; i <= roomNum; ++i) {
while (1) {
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d<><64><EFBFBD>ţ<EFBFBD>(1<>ŵ<EFBFBD>100<30><30>֮<EFBFBD><D6AE>)", i);
scanf("%i", &roomId);if(roomId==0) menu();
if (roomId < 0 || roomId >= 100) {
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
continue;
}
else
break;
}
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>סʱ<EFBFBD>Сʱ,<2C><><EFBFBD>ӣ<EFBFBD>");
scanf("%d,%d", &hour1, &minute1);if(hour1==0||minute1==0) menu;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD>ʱ<EFBFBD>Сʱ,<2C><><EFBFBD>ӣ<EFBFBD>");
scanf("%d,%d", &hour2, &minute2);if(hour2==0||minute2==0) menu;
int t, t1, t2, o, q;
t1 = hour1 * 60 + minute1;
t2 = hour2 * 60 + minute2;
t = t2 - t1;
o = t / 60;
q = t % 60;
if (q != 0)
o = o + 1;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ס<EFBFBD><EFBFBD>СʱΪ%dСʱ", o);
printf("\n<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼䣬2<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˫<EFBFBD>˼䣬3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼䣬4<EFBFBD><EFBFBD><EFBFBD><EFBFBD>VIP<EFBFBD>׷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ");
scanf("%d", &Nu);if(Nu==0) menu;
switch (Nu)
{
case 1:Numb+=(10*o);break;
case 2:Numb+=(19*o);break;
case 3:Numb+=(27*o);break;
case 4:Numb+=(45*o);break;
}
z[roomId]=0;
memset(room+roomId,0,sizeof(room));
}
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d Ԫ", Numb);
}
void save() //<2F><><EFBFBD><EFBFBD><E6BAAF>
{
FILE *fp;
int i;
if((fp=fopen("<EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.txt","w+"))==NULL) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"<22>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>.txt"
{printf("cannot open file\n");
exit(0);
}
for(i=0;i<100;i++)
{
if(fwrite((&room[i]), sizeof(room[100]),1,fp)!=1)
printf("file write error\n");
fflush(fp);
}
fclose(fp); //<2F>ر<EFBFBD><D8B1>ļ<EFBFBD>
}