Skip to content

Instantly share code, notes, and snippets.

@iporsut
Created July 16, 2011 06:15
Show Gist options
  • Save iporsut/1086068 to your computer and use it in GitHub Desktop.
Save iporsut/1086068 to your computer and use it in GitHub Desktop.
FatMouse
package Main;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
public class FatMouseDict {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
Map<String, String> map = new HashMap<String, String>();
boolean wordFlag = false;
while(scan.hasNextLine()) {
String s = scan.nextLine();
if (s.equals("")) {
wordFlag = true;
continue;
} else {
if (wordFlag) {
if (map.containsKey(s))
System.out.println(map.get(s));
else
System.out.println("eh");
} else {
String [] dicts = s.split(" ");
map.put(dicts[1], dicts[0]);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment