fork download
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. bool isVowel( char a )
  5. {
  6. return std::string( "aeiouy" ).find( a ) != std::string::npos;
  7. }
  8.  
  9.  
  10. int main() {
  11. std::string source = "hello world";
  12. std::string target;
  13. std::copy_if( source.begin(), source.end(), std::back_inserter( target ),
  14. []( char c ) { return not isVowel( c ); } );
  15. std::cout << target << std::endl;
  16. return 0;
  17. }
Success #stdin #stdout 0s 4496KB
stdin
Standard input is empty
stdout
hll wrld