Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
121394 任艺宸 如何得到"hello" C++ Compile Error 0 MS 0 KB 526 2025-06-07 12:19:42

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ char a[10000],b[5]={"h","e","l","l","o"}; cin>>a; int l=0; for(int i=0;a[i]!='\0';i++) { if(a==b){ l++; } } if(l==5){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:44: error: too many initializers for 'char [5]'
     char a[10000],b[5]={"h","e","l","l","o"};
                                            ^