⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 4035644_ac_1250ms_17916k.java

📁 北大大牛代码 1240道题的原代码 超级权威
💻 JAVA
字号:
import java.util.*;
import java.io.*;

public class Main {
	private BufferedReader br;
	private TreeMap <String, String> dictionary;

	public static void main(String[] args) {
		try {
			new Main().run();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private void run() throws Exception {
		br = new BufferedReader(new InputStreamReader(System.in));
		dictionary = new TreeMap <String, String> ();
		String line;
		while (true) {
			line = br.readLine();
			if (line.length() == 0) {
				break;
			}
			int index = line.indexOf(' ');
			dictionary.put(line.substring(index + 1), line.substring(0, index));
		}
		String key;
		while (true) {
			key = br.readLine();
			String value = "";
			try {
				value = dictionary.get(key);
			} catch (Exception e) {
				System.exit(0);
			}
			System.out.println(value == null ? "eh" : value);
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -