Когда я запускаю свой код, он показывает недоступный код. Это не влияет на то, что я хочу напечатать. Но я просто не могу распечатать ввод от пользователя.
Я пытался определить CRT_SECURE_NO_WARNINGS, также не может помочь
Я ожидаю напечатать имя, SID, блок, общую сумму к оплате, но ничего не печаталось. Он будет печатать только имя, SID и т. Д., Но не вводит пользовательский ключ.
if(GDR==1 && type==3){
room_rate=150;
strcpy(r[i].block, "A3");
printf("\nHow many weeks of room booking?\n");
scanf("%i",&R_week);
printf("\nName\t\t:");
scanf("%s",r[i].name);
printf("Student ID\t :");
scanf("%s",r[i].SID);
printf("Type\t\t :%s\n",rm[i].type);
r[i].room=r[i].room+1;
A3_no=1+A3_no;
printf("\nDo you want to change your room type?\n1 Yes\n2 No\n3 Main Menu\nPlease enter your option:");
scanf("%i",&change);
if(change==1){
Room_Type();
Details();
goto start;}
if(change==2){
Meal2:
printf("\nDo you want to subscribe for Meal?\n1 Yes\n2 No\nPlease enter your option:");
scanf("%i",&A1_Meal);
if(A1_Meal==1){
printf("\n\nSorry, this service is not available for subscription. Thank you.\n");
goto Gym2;}
if(A1_Meal ==2){
goto Gym2;}
else{
goto Meal2;}
Gym2:
printf("\nDo you want to subscribe for Gym?\n1 Yes\n2 No\nPlease enter your option:");
scanf("%i",&A1_Gym);
if(A1_Gym==1){
printf("\nSorry, this service is not available for subscription. Thank you\n");
goto Internet2;}
if(A1_Gym==2){
goto Internet2;}
else{
goto Gym2;}
Internet2:
printf("\nDo you want to subscribe for Internet?\n1 Yes\n2 No\nPlease enter your option:");
scanf("%i",&A1_Internet);
if(A1_Internet==1){
Internet_rate=15;
printf("\nHow many weeks of subscription?\n");
scanf("%i",&I_week);
goto Laundry2;}
if(A1_Internet==2){
Internet_rate=15;
I_week=0;
goto Laundry2;}
else{
goto Internet2;}
Laundry2:
printf("\nDo you want to subscribe for Laundry?\n1 Yes\n2 No\nPlease enter your option:");
scanf("%i",&A1_Laundry);
if(A1_Laundry==1){
Laundry_rate=20;
printf("\nHow many weeks of subscription?\n");
scanf("%i",&L_week);
room_total= room_rate * R_week;
L_total = Laundry_rate * L_week;
I_total = Internet_rate * I_week;
r[i].total = room_total + I_total+L_total;
printf("\n============== Payment Details ===============\n");
printf("\nWeekly rate for the room\t: RM%i\n%i weeks of subscription\t\t: RM%i\nWeekly rate for the laundry\t: RM%i\n%i weeks of subscription\t\t: RM%i\nWeekly rate for the Internet\t: RM%i\n%i weeks of subscription\t\t: RM%i\n\nTotal amount payable is RM%i.\n",room_rate, R_week, room_total, Laundry_rate,L_week,L_total,Internet_rate,I_week,I_total,r[i].total);
goto Pay;}
if(A1_Laundry==2){
Laundry_rate=20;
L_week=0;
room_total= room_rate * R_week;
L_total = Laundry_rate * L_week;
I_total = Internet_rate * I_week;
r[i].total = room_total + I_total+L_total;
printf("\n============== Payment Details ===============\n");
printf("\nWeekly rate for the room\t: RM%i\n%i weeks of subscription\t\t: RM%i\nWeekly rate for the laundry\t: RM%i\n%i weeks of subscription\t\t: RM%i\nWeekly rate for the Internet\t: RM%i\n%i weeks of subscription\t\t: RM%i\n\nTotal amount payable is RM%i.\n",room_rate, R_week, room_total, Laundry_rate,L_week,L_total,Internet_rate,I_week,I_total,r[i].total);
goto Pay;}
else{
goto Laundry2;}
Pay2:
printf("==============================================\n");
printf("\nDo you want to cancel booking or proceed to make payment?\n1 Make Payment\n2 Cancel Booking\nPlease enter your option:");
scanf("%i",&cancel);
if(cancel==1){
printf("\nDo you want to make payment now or later by cash?\n1 Now\n2 Cash\nPlease enter your option:");
scanf("%i",&pay);
if(pay==1){
strcpy(r[i].PS, "Paid");
printf("\nPlease deposit your money in the slot provided.\nMaximum cash per deposit is 100 pieces of any combined denominations.\n");
printf("Thank you for your payment.\n\n");
goto Printing_2;
continue;}
if(pay==2){
strcpy(r[i].PS, "Pending");
printf("Please proceed to counter 1. Payment must be made within 7 days. Thank you.\n\n");
goto Printing_2;}
else{
goto Pay2;
break;}}
if(cancel==2){
goto Main_Menu;}
else{
goto Pay2;}
Printing_2:
printf("\n============== Hosteler Details ===============\n");
printf("Name\t\t: %s\nStudent ID\t: %s\nGender\t\t: %s\nBlock\t\t: %s\nRoom Number\t: %i\nType\t\t: %s\nTotal payable\t: RM%i\nPayment Status\t: %s",r[i].name,r[i].SID,rm[i].Gender,r[i].block,A3_no,rm[i].type,r[i].total,r[i].PS);
printf("\n============================================\n");}
if(change==3){
goto Main_Menu;}
else{
goto Main_Menu;}}