String Texto

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

{

String texto, resp="";

int cont=0;

String nf [];

String nv [];

String v []= {"a","e","i","o","u"};

Scanner sc= new Scanner(System.in);

System.out.println("Ingrese una frase");

texto= sc.nextLine();

nf=texto.split(" ");

nv= texto.split("");

for (int i = 0; i < nv.length; i++) {

for (int j = 0; j < v.length; j++) {

if(nv[i].equalsIgnoreCase(v[j])){

cont++;

// nv[i]=String.valueOf(j+1);

nv[i]=(j+1)+"";

for (int i = 0; i < nv.length; i++) {

resp=resp+nv[i];

System.out.println("Palabras: "+nf.length);

System.out.println("Vocales: "+cont);

System.out.println("Nueva frase: "+resp);

You might also like