TEMA
Presentation Error
andersonparagao preguntado 4 years ago
Prezados tudo bem? Meu código está dando "PE", fiz o teste na saída da descrição do problema e no uDebug e todos passaram, porém o código não passa. Desde já agradeço!
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner ler = new Scanner(System.in);
int qtd_iteracoes = ler.nextInt();
for (int i = 0; i <= qtd_iteracoes; i++) {
String texto = ler.nextLine();
//System.out.println("Texto Original = " + texto);
String textoCoreto = "";
for (int j = (texto.length()/2) - 1; j >= 0 ; j--) {
textoCoreto += texto.charAt(j);
}
for (int j = texto.length() - 1; j >= (texto.length()/2); j--) {
textoCoreto += texto.charAt(j);
}
System.out.println(textoCoreto);
}
System.out.println();
}
}