Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
88780 倪士燊 如何得到"hello" C++ Accepted 1 MS 276 KB 490 2024-08-21 11:57:58

Tests(20/20):


Code:

#include<bits/stdc++.h> using namespace std; char s[1501]; int n; int h=0,e=0,l=0,o=0; int main(){ cin >> s; int n = strlen(s); 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; }