Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6290 黄言岐 如何得到"hello" C++ Accepted 0 MS 268 KB 546 2025-01-16 15:44:31

Tests(20/20):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ char n[1501],j[10]="hello"; cin>>n; int p=0; bool f=false; for(int i=0;n[i]!='\0';i++){ if(n[i] == j[p]) p++; if(p==5){ f=true; break; } } if(f) cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }