import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(bf.readLine());
String[][] str = new String[a][3];
StringBuffer sb = new StringBuffer("");
for (int i = 0; i < a; i++) {
str[i] = bf.readLine().split(" ");
}
int b = Integer.parseInt(bf.readLine());
String[] buf = bf.readLine().split(" ");
for (int j = 0; j < b; j++) {
int x = Integer.parseInt(buf[j]);
for (int k = 0; k < a; k++) {
if (x == Integer.parseInt(str[k][1])) {
sb.append(str[k][0] + " " + str[k][2] + '\n');
}
continue;
}
}
System.out.println(sb.toString().trim());
}
}
PAT_B_1041_Java(15分)
最新推荐文章于 2020-07-18 18:54:32 发布