Коллеги, привет.
Опять не могу победить валидатор.
По мне так выполняю все условия.
Что не нравится системе?
package com.javarush.task.task08.task0829;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/*
Модернизация ПО
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
//list of addresses
HashMap<String, String> addresses = new HashMap<>();
while (true) {
String city = reader.readLine();
if (city.isEmpty()) {
break;
}
String family = reader.readLine();
addresses.put(city, family);
}
// System.out.println(addresses);
//read home number
while (true) {
String family2 = reader.readLine();
for (Map.Entry<String, String> entry : addresses.entrySet()) {
if (family2.equals(entry.getKey())) {
System.out.println(entry.getValue());
break;
}
}
}
}
}