-
Notifications
You must be signed in to change notification settings - Fork 0
/
reservation.c
50 lines (38 loc) · 1.4 KB
/
reservation.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*reservation.c よやく*/
#include "hotel.h"
reservation()
{
int i,menu;
FILE *file;
printf("\n====予約処理====\n");
file=fopen("reservation.txt","a");
for(i=0;i<MAX;i++){
printf("\n予約処理を行う場合は1、\n終了する場合は0を入力してください:");
scanf("%d",&menu);
if(menu==0)
break;
printf("\n予約する日付を入力してください:");
scanf("%d",&customer[i].p_reservation_r);
fprintf(file,"%d ",customer[i].p_reservation_r);
printf("名前を入力してください:");
scanf("%s",customer[i].p_name_r);
fprintf(file,"%s ",customer[i].p_name_r);
printf("電話番号を入力してください:");
scanf("%s",customer[i].p_tel_r);
fprintf(file,"%s ",customer[i].p_tel_r);
printf("顧客の住所を入力してください:");
scanf("%s",customer[i].p_address_r);
fprintf(file,"%s ",customer[i].p_address_r);
printf("料金を入力してください:");
scanf("%d",&customer[i].p_charge_r);
fprintf(file,"%d ",customer[i].p_charge_r);
printf("部屋のタイプを入力してください:");
scanf("%s",customer[i].p_roomTyp);
fprintf(file,"%s ",customer[i].p_roomTyp);
printf("部屋番号を入力してください:");
scanf("%d",&customer[i].p_roomNo_r);
fprintf(file,"%d\n",customer[i].p_roomNo_r);
}
fclose(file);
END2=i;
}