Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int vocalONo (char);
  6.  
  7. int main()
  8. {
  9. string texto;
  10. cout<< "Ingrese texto (ponga un punto al final)" << endl;
  11. cin>> texto;
  12. int j=0, i, finDeCadena=0;
  13.  
  14.  
  15.  
  16. while (texto[finDeCadena] != '.'){
  17. finDeCadena++;
  18. }
  19.  
  20. for (i=0; i<finDeCadena; i++){
  21. if (vocalONo(texto[i]) == 1 ) {
  22. j++;
  23. }
  24. }
  25.  
  26. cout << "La cantidad de vocales es: " << j <<endl;
  27.  
  28.  
  29. return 0;
  30. }
  31.  
  32. int vocalONo(char caracter){
  33. if (caracter == 'a' || caracter == 'e' || caracter == 'i' || caracter== 'o' || caracter == 'u') {
  34. return 1;
  35. }
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement