Concerto de lógica simples

adicionado .toLowerCase() para que strings com caracteres maiusculos nao sejam detectados como default
This commit is contained in:
2026-03-13 17:38:53 +00:00
parent d903763a19
commit 003fc4ba62

View File

@@ -35,7 +35,7 @@ public class BotsEncrypter {
int contador = 0;
String encodedword[] = new String[input.length()];
for (int i = 0; i < input.length(); i++) {
switch(input.charAt(i)){
switch(input.toLowerCase().charAt(i)){
case 'a' -> encodedword[i] = "0";
case 'b' -> encodedword[i] = "1";
case 'c' -> encodedword[i] = "2";
@@ -79,7 +79,7 @@ public class BotsEncrypter {
String input = scn.nextLine();
String decodedword[] = new String[input.length()];
for (int i = 0; i < input.length(); i++) {
switch(input.charAt(i)){
switch(input.toLowerCase().charAt(i)){
case '0' -> decodedword[i] = "a";
case '1' -> decodedword[i] = "b";
case '2' -> decodedword[i] = "c";