fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Scanner S = new Scanner(System.in);
  13. String velas = "3";
  14. String total ="";
  15.  
  16. while (total.equals(velas)== false){//aqui empieza el bucle
  17. System.out.println("introduce tu respuesta");
  18.  
  19. total = "3";
  20.  
  21.  
  22. if(total.equals(velas)==false){//este if es por si el usuario se equivoca
  23.  
  24. System.out.println("respuesta incorreta, ¿quieres una pista? \n pista 1 \n pista 2 \n pista 3 ");
  25.  
  26.  
  27.  
  28. int opcion = S.nextInt();
  29.  
  30. switch(opcion){
  31.  
  32. case 1:
  33.  
  34. System.out.println("Tienen que quedar cierta cantidad de velas al final");
  35. break;
  36. case 2:
  37.  
  38. System.out.println("segunda pista");
  39. break;
  40.  
  41. case 3:
  42.  
  43. System.out.println("tercera pista");
  44. break;
  45.  
  46. default:
  47. System.out.print("no existe esa opción");
  48.  
  49.  
  50. }
  51.  
  52. }
  53.  
  54.  
  55. }
  56. }
  57. }
Success #stdin #stdout 0.05s 4386816KB
stdin
Standard input is empty
stdout
introduce tu respuesta