Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
78912 刘济玮 如何得到"hello" C++ Accepted 0 MS 272 KB 411 2024-06-29 12:20:42

Tests(20/20):


Code:

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