I have no idea what is wrong.... somebody have a clue??
package pl.codegym.task.task10.task1019;
import java.io.*;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/*
Funkcjonalność to nie wszystko!
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
HashMap<String,Integer> map = new LinkedHashMap<>();
try {
for (int x = 0;; x++) {
int id = Integer.parseInt(reader.readLine());
String str = reader.readLine();
if (str.equals("")){
map.put("", id);
break;
}else {
map.put(str,id);
}
}
}catch (NumberFormatException ignored) {
}
for (Map.Entry<String, Integer> x: map.entrySet()) {
System.out.print(x.getValue() + " " + x.getKey());
if (x.getKey().isEmpty()){
break;
}else {
System.out.println();
}
}
}
}