Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.14 KB | None | 0 0
  1.  do{
  2.                System.out.print("Votre choix: ");
  3.                nombre_choisi = lecture_nombre.nextInt();
  4.                System.out.println();
  5.                if(nombre_choisi> limite_max || nombre_choisi < limite_min){
  6.                    System.out.println("--- Hors limite ---");
  7.                    System.out.println();
  8.                    nombre_essai++;
  9.                 }
  10.                else if(nombre_choisi > ChiffreCache && (nombre_choisi < limite_max && nombre_choisi > limite_min)){
  11.                    System.out.println("--- Trop grand ---");
  12.                    System.out.println();
  13.                    nombre_essai++;
  14.                 }
  15.                else if(nombre_choisi < ChiffreCache && (nombre_choisi < limite_max && nombre_choisi > limite_min)){
  16.                 System.out.println("--- Trop petit ---");
  17.                 System.out.println();
  18.                 nombre_essai++;
  19.                 }
  20.                
  21.             }while(nombre_choisi != ChiffreCache);
  22.             System.out.println("--- Bravo... Trouvé en " + nombre_essai + " coups");
  23.             System.out.println();
  24.             return nombre_essai;
  25.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement