Advertisement
semsem_elazazy

https://codeforces.com/group/n3sTiYtHxI/contest/348902/problem/I

Mar 18th, 2022
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. #define ll long long
  4. #define ull unsigned long long
  5. #define pi  3.14159
  6. //#define ceil(w, m) (((w) / (m)) + ((w) % (m) ? 1 : 0))
  7. using namespace std;
  8.  
  9. void yasmeen_fakhri(){
  10.   ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  11.   #ifndef ONLINE_JUDGE  
  12.     freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  13.   #endif
  14. }
  15.  
  16. bool is_vowel(char ch){
  17.   return (ch == 'a' || ch == 'o' || ch == 'e' || ch == 'i' || ch == 'u' || ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U') ;
  18. }
  19. //ll c=0 ;
  20. ll count_vowels(string s  , ll len ){
  21.     //if(len < 0) return;
  22.    if (len == 0)
  23.         return is_vowel(s[len-1]);
  24.  
  25.     return count_vowels(s, len-1) + is_vowel(s[len-1]);
  26. }
  27.  
  28.  
  29. int main() {
  30.    yasmeen_fakhri();
  31.  
  32. int test =1;
  33. //cin>>test;
  34. while(test--){
  35. string s;
  36. cin.ignore();
  37. getline (cin ,s);
  38. ll len =s.size();
  39. //count_vowels(s,len-1);
  40.   cout<<count_vowels(s,len-1) ;
  41. }
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement