SHOW:
|
|
- or go back to the newest paste.
1 | - | |
1 | + | for (int i = 0; i < 3; i++) { |
2 | - | for (int i = 0; i < 3; i++) { |
2 | + | System.out.println("Ingrese palabra " + (i + 1) + ":"); |
3 | - | System.out.println("Ingrese palabra "+(i+1)+":"); |
3 | + | |
4 | ||
5 | - | if ((int) op.length() != (int) lista1.get(i)) { |
5 | + | char[] chars = op.toCharArray(); |
6 | - | System.out.println("Ingresa la plabra correcta"); |
6 | + | for (char c : chars) { |
7 | - | i--; |
7 | + | if (!Character.isLetter(c)) { |
8 | - | } else { |
8 | + | System.out.println("Palabra no puede contener numeros"); |
9 | - | lista2.add(op); |
9 | + | } else { |
10 | - | |
10 | + | if ((int) op.length() != (int) lista1.get(i)) { |
11 | System.out.println("Ingresa la plabra correcta"); | |
12 | i--; | |
13 | } else { | |
14 | lista2.add(op); | |
15 | ||
16 | } | |
17 | } | |
18 | } | |
19 | } |