It says the value should not be lost and displayed but that is what happens.
package com.codegym.task.task10.task1019;
import java.io.*;
import java.util.*;
/*
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> map = new HashMap<>();
while(true) {
Integer id = Integer.parseInt(reader.readLine());
if(id == 0)
break;
String name = reader.readLine();
if(name.isEmpty() && !(id == 0)){
map.put(name,id);
break;
}else if(name.isEmpty())
break;
}
for(Map.Entry<String,Integer> entry : map.entrySet()){
System.out.println(entry.getValue()+" "+entry.getKey());
}
}
}