Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- Scanner leer = new Scanner(System.in);
- int cont = 0;
- int posicion;
- System.out.println("Dime una frase");
- String oracion = leer.nextLine();
- posicion = oracion.indexOf(" ");
- while (posicion != -1) {
- for (int i = 1; i < oracion.charAt(posicion) - 1; i++) {
- oracion.charAt(i);
- System.out.println(oracion);
- }
- posicion = oracion.indexOf(" ", posicion + 1);
- }
- }
Add Comment
Please, Sign In to add comment