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 50 51 52 53
| #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
long choix_menu;
long compteur = 0;
float prix = 0;
printf ("===MENU=== \n\n");
printf ("1. Royal Cheese \n");
printf ("2. Mc Deluxe \n");
printf ("3. Mc Bacon \n");
printf ("4. Big Mac \n\n");
printf ("Votre choix?");
scanf ("%ld" , &choix_menu);
printf ("\n");
switch (choix_menu)
{
case 1:
printf ("Vous avez choisi un Royal Cheese");
compteur ++;
prix ++;
break;
case 2:
printf ("Vous avez choisi un Mc Deluxe");
compteur ++;
prix ++;
break;
case 3:
printf ("Vous avez choisi un Mc Bacon");
compteur ++;
prix ++;
break;
case 4:
printf ("Vous avez choisi un Big Mac");
compteur ++;
prix ++;
break;
}
printf ("\n\nVous avez choisi %ld hamburger(s)" , compteur);
printf ("\n\nVous devez payer : %lf" , prix);
printf ("\n\n");
system("PAUSE");
return 0;
} |
Partager