Hi all,
Cannot pass the last condition. I read through another examples in the forum but I cannot understand what is wrong. Any hints?
Thanks,
Roman
package com.codegym.task.task08.task0829;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.sql.SQLOutput;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/*
Software update
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
HashMap<String, String> addresses = new HashMap<String, String>();
while (true) {
//int houseNumber = Integer.parseInt(reader.readLine());
String city = reader.readLine();
String family = reader.readLine();
if (city.isEmpty() || family.isEmpty()) break;
addresses.put(city, family);
}
String checkCity = reader.readLine();
if (addresses.containsKey(checkCity)){
System.out.println(addresses.get(checkCity));
} else {
System.out.println("verify your buggy code");
}
}
}