Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner teclado = new Scanner(System.in);
- int cont=0;
- for (int p=0;p<6 ;p++)
- {
- System.out.println("Ingrese palabra");
- String palabra = teclado.next();
- int indice= palabra.indexOf("ion");
- if(indice !=-1){
- {
- cont = cont+1;
- }
- }
- }
- System.out.println("Cantidad de palabras:"+ cont);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement