fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. string str;
  8. char vowel[6]={'a','e','i','o','u'};
  9. int total=0,cnty=0;
  10. cin>>str;
  11.  
  12. for(int i=0;i<str.size();i++){
  13. for(int j=0;j<5;j++){
  14. if(str[i]==vowel[j])
  15. total++;
  16. }
  17. if(str[i]=='y')
  18. cnty++;
  19. }
  20.  
  21. cout<<total<<' '<<total+cnty;
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 5320KB
stdin
asdfiy
stdout
2 3