import java.util.Scanner;
class ExerciciosClass01h {
public static String lerpalavra
(int ini,
int fim
) { Scanner ler
= new Scanner
(System.
in); System.
out.
println("Digite uma palavra:"); do {
palavra = ler.nextLine();
} while (palavra.length() < ini || palavra.length() > fim);
return palavra;
}
for (int ctcar = palavra.length() - 1; ctcar >= 0; ctcar--) {
invertida += trocaVogal(palavra.charAt(ctcar));
}
return invertida;
}
public static char trocaVogal(char letra) {
String vogais
= "AaEeIiOoUuAa"; int posicao = vogais.indexOf(letra);
if (posicao == -1) {
return letra;
}
return vogais.charAt(posicao + 2);
}
public static void main
(String[] args
) { System.
out.
println(criptografar
(lerpalavra
(1,
20))); }
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKY2xhc3MgRXhlcmNpY2lvc0NsYXNzMDFoIHsKICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIGxlcnBhbGF2cmEoaW50IGluaSwgaW50IGZpbSkgewogICAgICAgIFNjYW5uZXIgbGVyID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkRpZ2l0ZSB1bWEgcGFsYXZyYToiKTsKICAgICAgICBTdHJpbmcgcGFsYXZyYTsKICAgICAgICBkbyB7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnQoIi0+ICIpOwogICAgICAgICAgICBwYWxhdnJhID0gbGVyLm5leHRMaW5lKCk7CiAgICAgICAgfSB3aGlsZSAocGFsYXZyYS5sZW5ndGgoKSA8IGluaSB8fCBwYWxhdnJhLmxlbmd0aCgpID4gZmltKTsKICAgICAgICByZXR1cm4gcGFsYXZyYTsKICAgIH0KICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIGNyaXB0b2dyYWZhcihTdHJpbmcgcGFsYXZyYSkgewogICAgCVN0cmluZyBpbnZlcnRpZGEgPSAiIjsKICAgICAgICBmb3IgKGludCBjdGNhciA9IHBhbGF2cmEubGVuZ3RoKCkgLSAxOyBjdGNhciA+P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