Run ID:63037

提交时间:2023-12-31 16:20:53

#include<bits/stdc++.h> using namespace std; int main(){ int h=0,e=0,l=0,o=0; char s[1501]; cin>>s; int n=strlen(s); for(int i=0;i<n;i++){ if(s[i]=='h'){ h++; } if(s[i]=='e' && h>0){ e++; } if(s[i]=='l' && e>0){ l++; } if(s[i]=='o' && l>1){ o++; } } if(h>0 && e>0 && l>1 && o>0){ cout<<"YES"; }else{ cout<<"NO"; } return 0; }