diff options
Diffstat (limited to 'challenge-279/ulrich-rieke/cpp/ch-2.cpp')
| -rwxr-xr-x | challenge-279/ulrich-rieke/cpp/ch-2.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-279/ulrich-rieke/cpp/ch-2.cpp b/challenge-279/ulrich-rieke/cpp/ch-2.cpp new file mode 100755 index 0000000000..84455bf78a --- /dev/null +++ b/challenge-279/ulrich-rieke/cpp/ch-2.cpp @@ -0,0 +1,14 @@ +#include <string>
+#include <algorithm>
+#include <iostream>
+
+int main( ) {
+ std::cout << "Enter a string!\n" ;
+ std::string line ;
+ std::getline( std::cin , line ) ;
+ std::string vowels {"aeiouAEIOU"} ;
+ std::cout << std::boolalpha << (std::count_if( line.begin( ) , line.end( ),
+ [vowels]( char c ) { return vowels.find( c ) != std::string::npos ;
+ } ) % 2 == 0 ) << '\n' ;
+ return 0 ;
+}
|
