Run ID:88783
提交时间:2024-08-21 11:59:53
#include<bits/stdc++.h> using namespace std; char s[1501]; int main(){ cin >>s; int n=strlen(s); int h=0,e=0,l=0,o=0; for(int i=0; i<=n-1; i++){ if(s[i]=='h'){ h++; } if(s[i]=='e' && h>=1){ e++; } if(s[i]=='l' && e>=1){ l++; } if(s[i]=='o' && l>=2){ o++; cout <<"YES"; return 0; } } cout <<"NO"; return 0; }