Run ID:78905
提交时间:2024-06-29 12:18:59
#include<bits/stdc++.h> using namespace std; int main(){ char s[1501]; scanf("%s",s); int len = strlen(s); int h=0,e=0,l=0,o=0; for(int i=0;i<len;i++){ if(s[i]=='h'){ h++; }else if(s[i]=='e'&&'h'>=1){ e++; }else if(s[i]=='l'&&'e'>=1){ l++; }else if(s[i]=='o'&&'l'>=2){ o++; } } if(h>=1&&e>=1&&l>=2&&o>=1){ cout<<"YES"; }else{ cout<<"NO"; } return 0; }