output is good, but it wont verify. Says i have mixed up the values???
package com.codegym.task.task10.task1019;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
/*
Functionality is not enough!
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
HashMap<String, Integer> hashMap = new HashMap<>();
try {
while (true) {
Integer id = Integer.parseInt(reader.readLine());
if (id.toString().isEmpty()) break;
String name = reader.readLine();
if (name.isEmpty()) break;
hashMap.put(name, id);
}
}catch (Exception error){
}
// System.out.println("Id=" + id + " Name=" + name);
for (Map.Entry me : hashMap.entrySet()) {
System.out.println(me.getValue() + " " + me.getKey());
}
}
}