Advertisement
semsem_elazazy

M. Subsequence String

Feb 14th, 2022
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. #define ll long long
  4. using namespace std;
  5.  
  6. int main() {
  7. string s;
  8. cin>>s;
  9. string mys = "hello";
  10. int len =s.size();
  11. int z = 0 ;
  12. for(int i =0 ; i<len ; i++)
  13. {
  14.     while(true)
  15.     {
  16.         if (s[i] == mys[z])
  17.         z++;
  18.     }
  19.    
  20.    
  21. }
  22. if (z == 5 )
  23. {
  24.  cout<<"YES";
  25.    
  26. }
  27. else
  28. cout<<"NO";
  29.  
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement