Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
160117 颜学俊逸 如何得到"hello" C++ Accepted 1 MS 276 KB 336 2026-09-12 15:06:07

Tests(20/20):


Code:

#include<bits/stdc++.h> #include<cstring> using namespace std; string s,s1 = "hello"; int main() { cin >> s; int n = s.size(); int j = 0; for(int i = 0; i <= n - 1; i++) { if(s[i] == s1[j]) { j++; if(j == 5){ break; } } } if(j == 5){ cout << "YES"; }else{ cout << "NO"; } return 0; }