Estacion.java 1.66 KB
Newer Older
Cesar Giulano Gonzalez Maqueda committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
import java.util.InputMismatchException;
import java.util.Scanner;
import java.util.TreeMap;

public class Estacion {
    public static void main(String []args){
        Scanner in = new Scanner(System.in);
        int mes = 0;
        boolean repetir = true;

        try {
            mes = in.nextInt();
        }catch (InputMismatchException e) {
            System.out.println("El numero proveido no es un entero");
        }
        switch (mes){
            case 1:
                System.out.println("Es Verano");
                break;
            case 2:
                System.out.println("Es Verano");
                break;
            case 3:
                System.out.println("Es Otonho");
                break;
            case 4:
                System.out.println("Es Otonho");
                break;
            case 5:
                System.out.println("Es Otonho");
                break;
            case 6:
                System.out.println("Es Invierno");
                break;
            case 7:
                System.out.println("Es Invierno");
                break;
            case 8:
                System.out.println("Es Invierno");
                break;
            case 9:
                System.out.println("Es Primavera");
                break;
            case 10:
                System.out.println("Es Primavera");
                break;
            case 11:
                System.out.println("Es Primavera");
                break;
            case 12:
                System.out.println("Es Verano");
                break;
            default:
                System.out.println("Ese numero no corresponde a un mes del anho");
        }
    }

}