Advertisement
Guest User

Untitled

a guest
Sep 24th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main (void)
  6. {
  7. int input,essais,alea;
  8. srand( (unsigned)time( NULL ) );
  9. alea = rand()%100000000000000000000000000000000000000000000000000000000;
  10. while( input != alea ) {
  11. printf( "Entrer un nombre\n");
  12. scanf("%d", &input );
  13. essais = essais + 1;
  14.  
  15. //cette partie regarde si le nombre d'essais max a été atteint
  16. if (essais > 901)
  17. {
  18. printf("t'as perdu gros fils de pute de ta mere, le nombre c'etait %d\n", alea);
  19. system("pause");
  20. }
  21. //cette partie dis si le chiffre est trop grand ou petit
  22. if (input != alea )
  23. {
  24. printf("non, le resultat est ");
  25. if (input > alea )
  26. {
  27. printf("plus petit\n");
  28. }
  29. else
  30. {
  31. printf("plus grand\n");
  32. }
  33. }
  34. }
  35. printf( "bravo vous avez trouve avec %d essais", essais);
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement