From 003fc4ba6227a85f537b615e3e5dcd30944c8682 Mon Sep 17 00:00:00 2001 From: 250405 <250405@epvc.pt> Date: Fri, 13 Mar 2026 17:38:53 +0000 Subject: [PATCH] =?UTF-8?q?Concerto=20de=20l=C3=B3gica=20simples?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit adicionado .toLowerCase() para que strings com caracteres maiusculos nao sejam detectados como default --- src/main/java/com/mycompany/botsencrypter/BotsEncrypter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/mycompany/botsencrypter/BotsEncrypter.java b/src/main/java/com/mycompany/botsencrypter/BotsEncrypter.java index 2e3a218..6c3c1b3 100644 --- a/src/main/java/com/mycompany/botsencrypter/BotsEncrypter.java +++ b/src/main/java/com/mycompany/botsencrypter/BotsEncrypter.java @@ -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";