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
| #include <stdio.h>
int main (void)
{
char choix;
int ret;
puts ("VIEW : v ou V --> Consulter les informations\n"
"UPDATE : u ou U --> Mettre à jour les informations d'un demandeur\n"
"DELETE : d ou D --> Supprimer un demandeur\n"
"ADD : a ou A --> Ajouter un demandeur\n"
"SHOW : s ou S --> Montrer la représentation de l'arbre binaire");
do
{
char temp[2];
printf ("Commande:");
ret = scanf ("%1[vVuUdDaAsS]", temp);
scanf ("%*[^\n]"), getchar ();
if (ret == 1)
choix = temp[0];
}
while (ret != 1);
switch (choix)
{
case 'v':
case 'V':
puts ("cool");
break;
case 'u':
case 'U':
puts ("cool2");
break;
case 'd':
case 'D':
puts ("cool3");
break;
case 'a':
case 'A':
puts ("cool4");
break;
case 's':
case 'S':
puts ("cool5");
}
getchar ();
return 0;
} |