在 c 控制台窗口中,我无法让这个应用程序检查每个检查是否一致,所以就像在 java 中那样,而不是 if "while" 然后它会改变,只要条件不匹配它就会一遍又一遍地循环,直到你爆发
我怎么能在c中做到这一点?
case 1: //add
printf(OPENWINDOW);
printf("\t\tAdd A Reminder (enter the number)\n\n\n\n");
printf("for which day? \n\n");
int tempday;
scanf("%i", &tempday);
if ( tempday >= 32){
printf("sorry we dont go that high on days.. try again!\n");
scanf("%i", &tempday);}
printf("and which month my king? \n\n");
int tempmonth;
scanf("%i", &tempmonth);
if ( tempmonth > 12 ) {
printf("sorry we dont go that high on month... try again!\n");
scanf("%i", &tempmonth);}
printf("what year?\n\n");
int tempyear;
scanf("%i", &tempyear);
while ( tempyear < 2012 || tempyear > 2020 ){
printf("Wow that is an incorrect year and you know it, try again\n");
scanf("%i", tempyear);
printf("What do you want to call this reminder?");
// scanf("%c", char titletemp[]);
}
break;
case 2: // view
printf(OPENWINDOW);