Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
63037 段文昊 如何得到"hello" C++ Accepted 2 MS 280 KB 400 2023-12-31 16:20:53

Tests(20/20):


Code:

#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; }