| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 100657 | 杨登博 | 如何得到"hello" | C++ | Compile Error | 0 MS | 0 KB | 385 | 2024-12-09 20:16:57 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() int main(){ char a[1500],m[6]="hello"; cin>>a; int n=0,b; b=strlen(a); for(int i=0;i!='\0';i++){ a[i]==m[n] n++ } if(b==n) cout<<"YES"; else cout<<"NO"; return 0; }
Main.cc: In function 'int main()':
Main.cc:6:5: error: 'cin' was not declared in this scope
cin>>a;
^
Main.cc:6:5: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:60:18: note: 'std::cin'
extern istream cin; /// Linked to standard input
^
Main.cc:11:9: error: expected ';' before 'n'
n++
^
Main.cc:10:13: warning: statement has no effect [-Wunused-value]
a[i]==m[n]
^
Main.cc:14:5: error: 'cout' was not declared in this scope
cout<<"YES";
^
Main.cc:14:5: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:61:18: note: 'std::cout'
extern ostream cout; /// Linked to standard output
^
Main.cc:16:5: error: 'cout' was not declared in this scope
cout<<"NO";
^
Main.cc:16:5: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:61:18: note: 'std::cout'
extern ostream cout; /// Linked to standard output
^