Всем привет! Почему??
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.List;
import java.util.HashMap;
/*
Модернизация ПО
*/
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<String, String>();
while (true) {
String city = reader.readLine();
String family = reader.readLine();
if (city.isEmpty() || family.isEmpty()) break;
addresses.put(city,family);
}
// Read the house number
String cityName = reader.readLine();
for (java.util.Map.Entry entry: addresses.entrySet()) {
if (cityName.equals(entry.getKey())){
System.out.println(entry.getValue());
}
}
}
}