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> hm = new HashMap<>();
int id ;
String name;
int flag = 0;
try{
for(int i = 0; flag != 1 ; i++)
{
id = Integer.parseInt(reader.readLine());
name = reader.readLine();
if(name.isEmpty())
flag = 1;
if(flag == 1)
{
System.out.println("Id=" + id);
hm.put(name, id);
}
else
{
System.out.println("Id=" + id + " Name=" + name);
hm.put(name, id);
}
}}
catch(Exception e)
{
}
for(Map.Entry<String, Integer> s : hm.entrySet())
{
System.out.println(s.getKey() + " " + s.getValue());
}
}
}
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> hm = new HashMap<>();
int id ;
String name;
int flag = 0;
try{
for(int i = 0; flag != 1 ; i++)
{
id = Integer.parseInt(reader.readLine());
name = reader.readLine();
if(name.isEmpty())
flag = 1;
if(flag == 1)
{
System.out.println("Id=" + id);
hm.put(name, id);
}
else
{
System.out.println("Id=" + id + " Name=" + name);
hm.put(name, id);
}
}}
catch(Exception e)
{
}
for(Map.Entry<String, Integer> s : hm.entrySet())
{
System.out.println(s.getKey() + " " + s.getValue());
}
}
}