Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
125044 王金檐 如何得到"hello" C++ Compile Error 0 MS 0 KB 281 2025-07-13 10:45:07

Tests(0/0):


Code:

#include <iostream> #include <cstring> using namespace std; char a[1500]; char s[6]="hello"; int main(){ int k=0; cin>>a; int n=strlen(a); for(int i=0;i<n;i++){ if(a[i]==b[k]){ k++; } } if(k>4){ cout<<"YES"; }else{ cout<<"NO"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:11:12: error: 'b' was not declared in this scope
   if(a[i]==b[k]){
            ^