Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Es7 {
- public static void main(String[] args) {
- Scanner kb = new Scanner(System.in);
- while (true) {
- int i = kb.nextInt();
- switch (i) {
- case 1:
- System.out.println("Hai messo 1");
- break;
- case 2:
- System.out.println("hai messo 2");
- break;
- case 3:
- System.out.println("hai messo 3");
- break;
- default:
- System.out.println("non hai messo ne 1 ne 2 ne 3, ritenta");
- }
- if (i==1 || i==2 || i==3) System.exit(0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment