package day12;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Set;
public class HashTest02 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
HashMap<String, String> h = new HashMap<String, String>();
h.put("dog", "강아지");
h.put("cat", "고양이");
h.put("cow", "소");
h.put("pig", "돼지");
h.put("sheep", "양");
h.put("horse", "말");
h.put("bird", "새");
h.put("mouse", "쥐");
h.put("rabbit", "토끼");
h.put("tiger", "호랑이");
while(true) {
System.out.println("동물이름을 입력하세요");
String eng = sc.nextLine();
if(eng.equals("exit" )) {
System.out.println("프로그램 종료");
break;
}
String kor = h.get(eng);
if(kor == null) {
System.out.println("찾는단어가 없습니다.");
}else {
System.out.println(kor);
}
}
sc.close();
}
}