import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb=new StringBuffer();
int cases = Integer.parseInt(br.readLine());
HashMap<String,String> hm=new HashMap<String, String>();
for (int i = 0; i < cases; i++) {
hm.put(br.readLine().trim(),br.readLine().trim());
}
cases = Integer.parseInt(br.readLine());
for (int i = 0; i < cases; i++) {
sb.append(hm.get(br.readLine().trim())).append("\n");
}
System.out.print(sb);
}
}
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb=new StringBuffer();
int cases = Integer.parseInt(br.readLine());
HashMap<String,String> hm=new HashMap<String, String>();
for (int i = 0; i < cases; i++) {
hm.put(br.readLine().trim(),br.readLine().trim());
}
cases = Integer.parseInt(br.readLine());
for (int i = 0; i < cases; i++) {
sb.append(hm.get(br.readLine().trim())).append("\n");
}
System.out.print(sb);
}
}
No comments:
Post a Comment