| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 125048 | 陈华仁星 | 如何得到"hello" | C++ | Compile Error | 0 MS | 0 KB | 286 | 2025-07-13 10:47:00 |
#include <iostream> #include <cstring> using namespace std; char a[2000]; int b[10]="hello"; int main() { scanf("%s",a); int len = strlen(a); int k=0; for(int i=0;i<len;i++) { if(a[i]==b[k]) k++; } if(k>4) printf("YES"); else printf("NO"); return 0; }
Main.cc:5:11: error: array must be initialized with a brace-enclosed initializer
int b[10]="hello";
^
Main.cc: In function 'int main()':
Main.cc:8:15: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%s",a);
^