TOPIC
Runtime error (java)
Rafael Bellini asked 11 months ago
Não estou conseguindo encontrar o motivo deste erro, se aguém puder ajudar agradeço.
import java.util.Locale; import java.util.Scanner;
public class Main { public static void main(String[] args) {
Locale.setDefault(Locale.US);
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int n = Integer.parseInt(sc.nextLine());
for (int i = 0; i < n; i++) {
char[] s = sc.nextLine().toCharArray();
for (int j = 0; j < s.length; j++)
if (Character.isLetter(s[j]))
s[j] += 3;
s = new StringBuilder(new String(s)).reverse().toString().toCharArray();
for (int j = s.length / 2; j < s.length; j++)
s[j] -= 1;
System.out.println(s);
}
}
sc.close();
}
}
This topic was solved and cannot recieve new replies.