import java.util.Locale;
public class Main {
public static void main
(String[] args
) { System.
out.
println(TipoPokemon.
checkTipo("ROCK")); System.
out.
println(TipoPokemon.
checkTipo("bug")); System.
out.
println(TipoPokemon.
checkTipo("banana")); System.
out.
println(TipoPokemon.
checkTipo("banana cereja acerola")); System.
out.
println(TipoPokemon.
checkTipo("banana cereja dark acerola")); }
enum TipoPokemon {
FIRE, WATER, GRASS, ELECTRIC, ICE, DARK, GHOST, FAIRY, PSYCHIC,
DRAGON, POISON, GROUND, ROCK, NORMAL, BUG, FIGHTING, STEEL, FLYING;
String palavras
[] = texto.
split(" "); for (String palavra
: palavras
) { try {
TipoPokemon tipo
= valueOf
(palavra.
toUpperCase(Locale.
ROOT)); return "Olá";
// Ignora a exceção e continua no for.
}
}
return "";
}
}
}
aW1wb3J0IGphdmEudXRpbC5Mb2NhbGU7CgpwdWJsaWMgY2xhc3MgTWFpbiB7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKFRpcG9Qb2tlbW9uLmNoZWNrVGlwbygiUk9DSyIpKTsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oVGlwb1Bva2Vtb24uY2hlY2tUaXBvKCJidWciKSk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKFRpcG9Qb2tlbW9uLmNoZWNrVGlwbygiYmFuYW5hIikpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihUaXBvUG9rZW1vbi5jaGVja1RpcG8oImJhbmFuYSBjZXJlamEgYWNlcm9sYSIpKTsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oVGlwb1Bva2Vtb24uY2hlY2tUaXBvKCJiYW5hbmEgY2VyZWphIGRhcmsgYWNlcm9sYSIpKTsKICAgIH0KCiAgICBlbnVtIFRpcG9Qb2tlbW9uIHsKICAgICAgICBGSVJFLCBXQVRFUiwgR1JBU1MsIEVMRUNUUklDLCBJQ0UsIERBUkssIEdIT1NULCBGQUlSWSwgUFNZQ0hJQywKICAgICAgICBEUkFHT04sIFBPSVNPTiwgR1JPVU5ELCBST0NLLCBOT1JNQUwsIEJVRywgRklHSFRJTkcsIFNURUVMLCBGTFlJTkc7CgogICAgICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIGNoZWNrVGlwbyhTdHJpbmcgdGV4dG8pIHsKICAgICAgICAgICAgU3RyaW5nIHBhbGF2cmFzW10gPSB0ZXh0by5zcGxpdCgiICIpOwogICAgICAgICAgICBmb3IgKFN0cmluZyBwYWxhdnJhIDogcGFsYXZyYXMpIHsKICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgVGlwb1Bva2Vtb24gdGlwbyA9IHZhbHVlT2YocGFsYXZyYS50b1VwcGVyQ2FzZShMb2NhbGUuUk9PVCkpOwogICAgICAgICAgICAgICAgICAgIHJldHVybiAiT2zDoSI7CiAgICAgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgIC8vIElnbm9yYSBhIGV4Y2XDp8OjbyBlIGNvbnRpbnVhIG5vIGZvci4KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gIiI7CiAgICAgICAgfQogICAgfQoKfQ==