Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
88775 杨一诺 如何得到"hello" C++ Accepted 1 MS 272 KB 447 2024-08-21 11:42:48

Tests(20/20):


Code:

#include<bits/stdc++.h> using namespace std; char a[1500]; int h=0,e=0,l1=0,l2=0,o=0; int main() { cin>>a; int n=strlen(a); for(int i=0; i<=n-1; i++) { if(a[i]=='h') { h=1; continue; } if(a[i]=='e'&&h==1) { e=1; continue; } if(a[i]=='l'&&e==1) { l1+=1; continue; } if(a[i]=='o'&&l1>=2) { o=1; break; } } if(o==1) { cout<<"YES"; } else { cout<<"NO"; } return 0; }