diff --git a/sae.c b/sae.c index 7df43dc..9718a16 100644 --- a/sae.c +++ b/sae.c @@ -202,8 +202,8 @@ int Acti(int i) { int acti; printf("Choix de l'activité %d: badminton (1) | football (2) | zumba (3) | musculation (4) | squash (5) \n", i); - scanf("%*c%d", &acti); - while (acti != 1 && acti != 2 && acti != 3 && acti != 4 && acti != 5) + scanf("%d%*c", &acti); + while (acti <= 0 && acti >= 6) { printf("Veuillez entrer un nombre d'activité correct (badminton (1) | football (2) | zumba (3) | musculation (4) | squash (5))\n"); scanf("%d%*c", &acti); @@ -394,7 +394,7 @@ void Loop(int *tAd, char tnom[][15], char tpnom[][15], int *tage, int *tstate, i scanf("%*c%d", &nbacti); } - chxacti = ChoiceActi(nbacti, tacti); + chxacti = ChoiceActi(nbacti, tacti); CheckPts(tptsbonus, tptsbought, tpasseoupas, tacti, tcateg, place, chxacti, insuf); if (*insuf == 1) { @@ -409,4 +409,4 @@ void Loop(int *tAd, char tnom[][15], char tpnom[][15], int *tage, int *tstate, i *choix = ChoiceMenu(); } -} \ No newline at end of file +}