Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
134912 田祥江 如何得到"hello" C++ Compile Error 0 MS 0 KB 342 2025-11-01 17:16:33

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; char a[51]="hello",b[51]; int main(){ int k=0; cin>>b; int l=strlen(b); for (int i=0;i<len;i++) { if(b[i]==a[k]){ k++ if(k==5){ cout<<"YES"; return 0; } } } if(k<5) cout<<"NO"; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:20: error: 'len' was not declared in this scope
     for (int i=0;i