fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4.  
  5. bool isVowel(char c)
  6. {
  7. return c=='a' || c=='e' || c=='i' || c=='o' || c=='u';
  8. }
  9.  
  10. void checkString(string s)
  11. {
  12. int v=0;
  13. int c=0;
  14.  
  15. //Your code here
  16. for(auto ch : s)
  17. {
  18. if(ch == ' ')
  19. continue;
  20. if(isVowel(ch))
  21. v++;
  22. else
  23. c++;
  24. }
  25.  
  26. if(v>c)
  27. cout<<"Yes";
  28. else if(c>v)
  29. cout<<"No";
  30. else
  31. cout<<"Same";
  32.  
  33. cout<<endl;
  34. }
  35.  
  36. int main()
  37. {
  38. int t;
  39. cin>>t;
  40. cin.ignore();
  41. while(t--)
  42. {
  43. string S;
  44. getline(cin,S);
  45. checkString(S);
  46. }
  47. }
  48.  
  49.  
  50.  
Success #stdin #stdout 0s 4576KB
stdin
2
the quick brown fox jumps over the lazy dog
aaaaaa
stdout
No
Yes