Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
111325 魏宏搏 如何得到"hello" C++ Accepted 1 MS 280 KB 355 2025-03-01 11:50:26

Tests(20/20):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ string a; string b="hello"; //记录hello的下标 cin>>a; int i=0; int len=a.size(); for(int j=0;j<len;j++){ if(a[j]==b[i]){ i++; if(i==5){ break; } } } if(i==5){ cout<<"YES"; } else{ cout<<"NO"; } return 0; }