Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
71750 孙诗皓 如何得到"hello" C++ Compile Error 0 MS 0 KB 363 2024-04-27 16:12:16

Tests(0/0):


Code:

#include <iostream> #include <cmath> using namespace std; int main() { char a[1501],b[5]={'h','e','l','l','o'}; cin>>a; int len=strlen(a),y=1; for(int i=1;i<=len;i++) { if(a[i]==b[y]) { y++; } } if(y==5) cout<<"YES"; else cout<<"NO"; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:21: error: 'strlen' was not declared in this scope
     int len=strlen(a),y=1;
                     ^
Main.cc:11:20: error: 'y' was not declared in this scope
         if(a[i]==b[y])
                    ^
Main.cc:16:8: error: 'y' was not declared in this scope
     if(y==5)
        ^