Guest User

Untitled

a guest
May 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #include <bcio.h>
  2. #include <conio.h>
  3. #include <stdio.h>
  4. #define TAILLE 10
  5.  
  6. int main(void)
  7. {
  8.  
  9. int tabCombiUser[TAILLE];
  10. int nb,trouve,val;
  11. int I=1,J=0,x=0;
  12. char Bla;
  13.  
  14. do {
  15. do {
  16. bcdisplayln("Combien de valeurs?");
  17. bcget(nb);
  18. }
  19. while (nb < 0 || nb > 10);
  20. do {
  21. bcdisplayln("Entrez la valeur ",I);
  22. bcget(tabCombiUser[0]);
  23. }
  24. while (tabCombiUser[0] < 0 || tabCombiUser[0] > 100);
  25. I++;
  26. while (I<=nb)
  27. {
  28. do {
  29. printf("Entrez la valeur %i\n", I);
  30. bcget(val);
  31. fflush(stdin);
  32. }
  33. while (val < 0 || val > 100);
  34. trouve = 0;
  35. J=0;
  36. while (J<nb && trouve == 0)
  37. {
  38. if (tabCombiUser[J] == val )
  39. {
  40. bcdisplayln("Attention, les valeurs doivent toutes etre differentes");
  41. trouve =1;
  42. }
  43. J++;
  44.  
  45. }
  46. if (trouve == 0)
  47. {
  48. x++;
  49. tabCombiUser[x]=val;
  50. I++;
  51. }
  52. }
  53.  
  54. bcdisplay("Votre combinaison est ");
  55. for (x=0;x<nb;x++)
  56. {
  57. bcdisplay(tabCombiUser[x]);
  58. bcdisplay(" ");
  59. }
  60. bcdisplayln("Rejouer?");
  61. bcget(Bla);
  62. }
  63. while (Bla == 13);
  64. bcgetpause();
  65. return 0;
  66.  
  67. }
Add Comment
Please, Sign In to add comment