fork download
  1. #include<iostream>
  2. #include<string>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7. int n;
  8. string str;
  9.  
  10. cin>>n;
  11.  
  12.  
  13. for(int i=0;i<n;i++){
  14. int cons=0, vowel=0;
  15. getline(cin, str);
  16.  
  17. for(int j=0;j<str.size();j++){
  18. switch(str[j]){
  19. case 'A':
  20. case 'E':
  21. case 'I':
  22. case 'O':
  23. case 'U':
  24. case 'a':
  25. case 'e':
  26. case 'i':
  27. case 'o':
  28. case 'u':
  29. vowel++;
  30. break;
  31. case ' ':
  32. break;
  33. default:
  34. cons++;
  35. break;
  36. }
  37. }
  38.  
  39. cout<<cons<<' '<<vowel<<"\n";
  40. }
  41. }
Success #stdin #stdout 0.01s 5320KB
stdin
3
You can win this thing
May be too optimistic
Just try to have fun
stdout
0 0
12 6
10 8