fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. char toCaps(char c) {
  5. return c - 'a' + 'A';
  6. }
  7.  
  8. bool isVowel(char c) {
  9. if (c >= 'a' && c <= 'z')
  10. c = toCaps(c);
  11. return c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U';
  12. }
  13.  
  14. int main(void) {
  15. std::string str;
  16. std::string ans;
  17. std::cin >> str;
  18. for (char ch: str)
  19. if (!isVowel(ch))
  20. ans += ch;
  21. std::cout << ans;
  22. return 0;
  23. }
Success #stdin #stdout 0s 4208KB
stdin
qwEertyaDIAEe
stdout
qwrtyD