AcWing 670. 动物 - Java
原题链接
简单
作者:
KYCygni
,
2021-03-07 15:31:12
,
所有人可见
,
阅读 367
Java 代码
import java.util.Scanner;
import java.util.HashMap;
public class Main
{
public static String[] i = {"vertebrado", "invertebrado"};
public static String[] j = {"ave", "mamifero", "inseto", "anelideo"};
public static String[] k = {"carnivoro", "onivoro", "herbivoro", "hematofago"};
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
String a = cin.nextLine();
String b = cin.nextLine();
String c = cin.nextLine();
HashMap m = new HashMap();
m.put(i[0]+j[0]+k[0], "aguia");
m.put(i[0]+j[0]+k[1], "pomba");
m.put(i[0]+j[1]+k[1], "homem");
m.put(i[0]+j[1]+k[2], "vaca");
m.put(i[1]+j[2]+k[3], "pulga");
m.put(i[1]+j[2]+k[2], "lagarta");
m.put(i[1]+j[3]+k[3], "sanguessuga");
m.put(i[1]+j[3]+k[1], "minhoca");
System.out.println (m.get(a+b+c));
}
}