fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. int main() {
  5. std::string s;
  6. std::cin >> s;
  7.  
  8. std::string hello = "hello";
  9. int j = 0;
  10.  
  11. for (int i = 0; i < s.size(); ++i) {
  12. if (s[i] == hello[j]) {
  13. j++;
  14. }
  15. if (j == 5) {
  16. std::cout << "YES" << std::endl;
  17. return 0;
  18. }
  19. }
  20.  
  21. std::cout << "NO" << std::endl;
  22.  
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 5312KB
stdin
hlelo
stdout
NO