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. int
  13. dado = 4;
  14.  
  15. switch(dado)
  16. {
  17. case 1:
  18. System.out.println("e' uscito un numero dispari");break;
  19.  
  20. case 2:
  21. System.out.println("e' uscito un numero pari");break;
  22. case 3:
  23. System.out.println("e' uscito un numero dispari");break;
  24.  
  25. case 4:
  26. System.out.println("e' uscito un numero pari");break;
  27. case 5:
  28. System.out.println("e' uscito un numero dispari");break;
  29.  
  30. case 6:
  31. System.out.println("e' uscito un numero pari");break;
  32. default:
  33. System.out.println("il valore inserito e' errato");break;
  34. }
  35. }
  36. }
Success #stdin #stdout 0.07s 52424KB
stdin
Standard input is empty
stdout
e' uscito un numero pari