Run ID:6288
提交时间:2025-01-16 15:41:49
# include<iostream> # include<cstring> using namespace std; int main(){ char s[1505],a[10]="hello";//指针j // j=0,j=1,j=2 cin>>s; //遍历小明输入的字符s //int n=strlen(s); int p=0; for(int i=0;s[i]!='\0';i++){ if(s[i] == a[p]) p++; if(p==5) { cout<<"YES"; return 0; } } cout<<"NO"; return 0; } //如果可以变成“hello”, 输出“YES”, 否则输出“NO”