fork download
  1.  
  2. #include<iostream>
  3. #include<string>
  4. #include<cmath>
  5. #include<algorithm>
  6. #include<vector>
  7.  
  8.  
  9. using namespace std;
  10.  
  11.  
  12. #define Alaa ios_base::sync_with_stdio(false);cin.tie(0);
  13. #define ll long long
  14. #define r 1000000007;
  15. bool check_vow(char d){
  16.  
  17. if(d=='a'||d=='e'||d=='i'||d=='o'||d=='u'||d=='y'){
  18. return true;
  19.  
  20. }
  21. return false;
  22. }
  23.  
  24. int main()
  25. {
  26. Alaa;
  27. int n; cin>>n; string s; cin>>s; int cnt=0;
  28. int cntv=0, cntc=0;
  29. for(int i=0;i<s.length();i++){
  30. if(check_vow(s[i])){
  31. cntv++;
  32. }
  33. else if(!check_vow(s[i])){
  34. cntc++;
  35. }
  36.  
  37. if(cntv>=1&&cntc>=1){
  38. cnt++;
  39. cntv=0; cntc=0;
  40.  
  41. }}
  42. cout<<cnt;
  43.  
  44. return 0;
  45. }
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty