这个题是我理解有问题吗
package zh.codegym.task.task08.task0829;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
/*
软件更新
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
// 地址列表
HashMap<String,String> map = new HashMap<>();
while (true) {
String city = reader.readLine();
String family = reader.readLine();
if (city.isEmpty()) {
break;
}
map.put(city,family);
}
String city = reader.readLine();
Iterator<Map.Entry<String,String>> iterator = map.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry<String,String> pair = iterator.next();
String key = pair.getKey();
String value = pair.getValue();
if(key.equals(city)){
System.out.println(value);
}
}
}
}