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
| #include <stdio.h>
#include <stdlib.h>
int main (void){
int n,m,i;
int rand();
srand(time(NULL));
n=0+rand()%100;
printf("Jeu de la Devinette : Tenter de trouver le nombre ! (Vous avez 5 tentatives) \n");
printf("Entrez un nombre : ");
scanf ("%d",&m);
while (n!=m){
for (i=0;i<=4;i++){
if(m<n)
printf("Le nombre mystère est plus grand ! \n");
if (m>n)
printf("Le nombre mystère est plus petit ! \n");
}
}
printf("Bravo !! Vous êtes pas mauvais !");
return EXIT_SUCCESS;
} |
Partager