Ahmed_Negm

Untitled

Mar 16th, 2022
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. #include<iomanip>
  4. #include<algorithm>
  5. #include<cstdlib>
  6. #include<cstring>
  7. #include<vector>
  8.  
  9. #define ll long long
  10. #define sz(x) int(x.size())
  11. #define all(x) x.begin(),x.end()
  12. using namespace std;
  13.  
  14. void Fast_IO(){
  15.     ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  16.     #ifndef ONLINE_JUDGE
  17.         freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  18.     #endif
  19. }
  20.  
  21.  int counter=0;
  22. string s;
  23. int count(int idx){
  24.    
  25. if(idx == 0) return counter;
  26. if(s[idx] == 'a' || s[idx] == 'e' || s[idx] == 'o' || s[idx] == 'i' || s[idx] == 'u' || s[idx] == 'A' || s[idx] == 'E' || s[idx] == 'O' || s[idx] == 'I' || s[idx] == 'U') counter++;
  27. return count(idx-1);
  28. }
  29.  
  30.  
  31.  
  32. void solve(){
  33.  
  34.  
  35. getline(cin,s);
  36. cout<<count(sz(s)-1);
  37.  
  38. }
  39.  
  40. int main(){
  41.     Fast_IO();
  42. int t =1;
  43. //cin>>t;
  44. while(t--){
  45. solve();
  46. }
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment