Run ID:62991
提交时间:2023-12-31 10:26:26
#include<bits/stdc++.h> using namespace std; int main() { int h=0,e=0,l=0,o=0; char s[1501]; cin>>s; int ls=strlen(s); for(int i=0;i<ls;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; }