Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2589 邓程允 字符串长度判断 C++ Compile Error 0 MS 0 KB 342 2024-01-13 18:26:06

Tests(0/0):


Code:

# include<iostream> using namespace std; int main(){ char a[151],b[151]; cin>>a>>b; int len_a=0,len_b=0; while(a[len_a]!="/0"){ len_a++; } while(b[len_b]!="/0"){ len_b++; } if(len_a==len_b){ cout<<"yes"; } else { cout<<"no"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:21: warning: comparison with string literal results in unspecified behaviour [-Waddress]
     while(a[len_a]!="/0"){
                     ^
Main.cc:7:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
Main.cc:10:21: warning: comparison with string literal results in unspecified behaviour [-Waddress]
     while(b[len_b]!="/0"){
                     ^
Main.cc:10:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]