RcrdBrt

Untitled

Nov 10th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Es7 {
  3. public static void main(String[] args) {
  4. Scanner kb = new Scanner(System.in);
  5. while (true) {
  6. int i = kb.nextInt();
  7. switch (i) {
  8. case 1:
  9. System.out.println("Hai messo 1");
  10. break;
  11. case 2:
  12. System.out.println("hai messo 2");
  13. break;
  14. case 3:
  15. System.out.println("hai messo 3");
  16. break;
  17. default:
  18. System.out.println("non hai messo ne 1 ne 2 ne 3, ritenta");
  19. }
  20. if (i==1 || i==2 || i==3) System.exit(0);
  21.  
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment