Advertisement
Spocoman

06. Vowels Count

Nov 17th, 2023
677
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. string vowelsTextReducer(string s) {
  6.     string vowels = "aeiouy", text = "";
  7.     for (int i = 0; i < s.length(); i++) {
  8.         if (vowels.find(tolower(s[i])) != -1) {
  9.             text += s[i];
  10.         }
  11.     }
  12.     return text;
  13. }
  14.  
  15. int main() {
  16.     string text;
  17.     cin >> text;
  18.  
  19.     cout << vowelsTextReducer(text).length() << endl;
  20.    
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement