-
Notifications
You must be signed in to change notification settings - Fork 2
/
Main.java
34 lines (32 loc) · 1.02 KB
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package L1_005;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
/**
* @author zmj
* @create 2019/4/29
*/
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
HashMap<String, String> mp = new HashMap<String, String>();
for (int i = 0; i < n; i++) {
String[] line = br.readLine().split(" ");
String number = line[0] + " " + line[2];
String a = line[1];
mp.put(a, number);
}
int m = Integer.parseInt(br.readLine());
ArrayList<String> pr = new ArrayList<String>();
String[] find = br.readLine().split(" ");
for (int i = 0; i < m; i++) {
pr.add(mp.get(find[i]));
}
for (int i = 0; i < m; i++) {
System.out.println(pr.get(i));
}
}
}