Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
82690 张之隽 如何得到"hello" C++ Compile Error 0 MS 0 KB 266 2024-07-13 14:43:04

Tests(0/0):


Code:

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


Run Info:

Main.cc:1:20: warning: extra tokens at end of #include directive
 #include #include 
                    ^
Main.cc: In function 'int main()':
Main.cc:2:111: error: 'strlen' was not declared in this scope
 using namespace std; int main(){ int b[5]={'h','e','l','l','o'}; char a[1500]; int q=0; cin>>a; int k=strlen(a); for(int i=0;i