Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
119724 黄睿杰 如何得到"hello" C++ Compile Error 0 MS 0 KB 229 2025-05-18 16:38:47

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:18: error: 'strlen' was not declared in this scope
  int len=strlen(b),s=0;
                  ^
Main.cc:8:14: error: 's' was not declared in this scope
   if(a[i]==b[s]) s++;
              ^
Main.cc:10:5: error: 's' was not declared in this scope
  if(s==5) cout<<"YES";
     ^