fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <sstream>
  4. #include <iterator>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9.  
  10. string str;
  11. getline(cin, str);
  12.  
  13. cout << *max_element(istream_iterator<string>(*(new stringstream(str))), istream_iterator<string>(),
  14. [](const string &lh, const string &rh) {
  15. auto vowels_count = [] (const string &str) {
  16. return count_if(str.begin(), str.end(),
  17. [](const string::value_type &c) {
  18. const string vowels = "aeiouy";
  19. return find(vowels.begin(), vowels.end(), c) != vowels.end();
  20. }
  21. );
  22. };
  23. return vowels_count(lh) < vowels_count(rh);
  24. }
  25. ) << endl;
  26. }
  27.  
Success #stdin #stdout 0s 3480KB
stdin
hello world my dear friend
stdout
hello