package com.javarush.task.task08.task0828; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; /* Номер месяца */ public class Solution { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String month = reader.readLine(); search(createMap(), month); } public static Map<String, String> createMap() { Map<String, String> months = new HashMap<>(); months.put("January","January is the 1 month"); months.put("February","February is the 2 month"); months.put("Mach","Mach is the 3 month"); months.put("April","April is the 4 month"); months.put("May","May is the 5 month"); months.put("June","June is the 6 month"); months.put("July","July is the 7 month"); months.put("August","August is the 8 month"); months.put("September","September is the 9 month"); months.put("October","October is the 10 month"); months.put("November","November is the 11 month"); months.put("December","December is the 12 month"); return months; } public static void search(Map<String, String> map, String inpStr) { for (Map.Entry<String, String> pair : map.entrySet()) { if (inpStr.equals(pair.getKey())) { System.out.println(pair.getValue()); } } } }