Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
88783 | 王馨桐 | 如何得到"hello" | C++ | Accepted | 1 MS | 280 KB | 376 | 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; }