BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
Map<String, Integer> map = new HashMap<>();
map.put("January",0);
map.put("February",1);
map.put("March",2);
map.put("April",3);
map.put("May",4);
map.put("June",5);
map.put("July",6);
map.put("August",7);
map.put("September",8);
map.put("October",9);
map.put("November",10);
map.put("December",11);
for(Map.Entry<String, Integer> itr : map.entrySet()){
if (s.equals(itr.getKey())){
int i = itr.getValue() + 1;
System.out.println("\""+ s + " is the " + i + " month\".");
}
}
package com.javarush.task.task08.task0828;
import java.io.*;
import java.util.*;
/*
Номер месяца
*/
public class Solution {
public static void main(String[] args) throws IOException {
//напишите тут ваш код
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
Map<String, Integer> map = new HashMap<>();
map.put("January",0);
map.put("February",1);
map.put("March",2);
map.put("April",3);
map.put("May",4);
map.put("June",5);
map.put("July",6);
map.put("August",7);
map.put("September",8);
map.put("October",9);
map.put("November",10);
map.put("December",11);
for(Map.Entry<String, Integer> itr : map.entrySet()){
if (s.equals(itr.getKey())){
int i = itr.getValue() + 1;
System.out.println("\""+ s + " is the " + i + " month\".");
}
}
}
}