fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.util.Scanner;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. Scanner lector= new Scanner(System.in);
  14.  
  15. System.out.println("Di algo");
  16. String input = lector.nextLine();
  17.  
  18. System.out.println(input);
  19.  
  20. if (input.equals ("Hola") || input.equals("hola") || input.equals("ola"))
  21. {
  22. System.out.println("Hola, humano");
  23. }
  24. else if (input.equals("quien eres"))
  25. {
  26. System.out.println("Una pobre ilusión de inteligencia artificial");
  27. }
  28. else
  29. {
  30. System.out.println("Adiós");
  31. }
  32. }
  33. }
Success #stdin #stdout 0.06s 711680KB
stdin
quien eres
stdout
Di algo
quien eres
Una pobre ilusión de inteligencia artificial