#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX_FLIGHTCODE_LEN 6
int main()
{
int choice;
int monthd;
int dayd;
int hourd;
int minuted;
int montha;
int daya;
int houra;
int minutea;
char flightcode[MAX_FLIGHTCODE_LEN+1];
char arrival_city [MAX_CITYCODE_LEN+1];
flight_t flights [MAX_NUM_FLIGHTS];
do
{
printf("1. add a flight\n");
printf("2. display all flights to a destination\n");
printf("3. save the flights to the database file\n");
printf("4. load the flights from the database file\n");
printf("5. exit the program\n");
printf("Enter choice (number between 1-5)>\n");
scanf("%d",&choice);
switch (choice)
{
case (1):
printf("Enter the flight code: \n");
scanf("%s",&flightcode[MAX_FLIGHTCODE_LEN+1]);
printf("Enter departure info for the flight leaving SYD.\n");
printf("Enter month, date, hour and minute separated by spaces>\n");
scanf("%d %d %d %d",monthd,dayd,hourd,minuted);
continue;
case (2):
printf("yay");
continue;
case (3):
printf("Goodbye\n");
continue;
default: printf("Wrong Choice. Enter again\n");
break;
}
} while (choice != 3);
return 0;
}
В случае 1 мне нужно, чтобы программа вернулась к printf («Введите месяц, дату, часы и минуты, разделенные пробелами> \ n»); если пользователь вводит бессмысленные значения для scanf («% d% d% d% d», monthd, dayd, hourd, minuted); спасибо за любую помощь