0
I have an exercise to do with this theme but I can’t reverse the second part after a special character.
Example: teste_baixo#123
would be traded for etset_oxiab#321
.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
PilhaInt pilha = new PilhaInt();
pilha.init();
Scanner teclado = new Scanner(System.in);
String senha = new String();
String salva = new String();
System.out.println("insira senha= ");
senha = teclado.nextLine();
for (int i = 0; i < senha.length(); i++) {
if (senha.charAt(i) != '_' && senha.charAt(i) != '#') {
pilha.push(senha.charAt(i));
}else{
for (int j = i-1; j >= 0; j--) {
System.out.printf("%c",senha.charAt(j));
}
System.out.println(senha.charAt(i));
}
System.out.println(pilha.topo);
}
}
}
magnificent face, full and clear explanation, thank you very much!!
– D3T0NA