Created
July 16, 2011 06:15
-
-
Save iporsut/1086068 to your computer and use it in GitHub Desktop.
FatMouse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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