| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 62198 | 万隽宇 | 字符串长度判断 | C++ | Compile Error | 0 MS | 0 KB | 239 | 2023-12-18 18:56:49 |
# include<iostream> using namespace std; int main(){ char a[150],b[150]; int c=0,d=0; cin>>a>>b; while(a[c] != "/0"){ c++; } while(a[d] != "/0"){ d++; } if(c==d) cout<<"yes"; else{ cout<<"no" } return 0; }
Main.cc: In function 'int main()':
Main.cc:7:15: warning: comparison with string literal results in unspecified behaviour [-Waddress]
while(a[c] != "/0"){
^
Main.cc:7:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
Main.cc:10:15: warning: comparison with string literal results in unspecified behaviour [-Waddress]
while(a[d] != "/0"){
^
Main.cc:10:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
Main.cc:17:1: error: expected ';' before '}' token
}
^