Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
152819 肖之睿 字符串长度判断 C++ Compile Error 0 MS 0 KB 588 2026-05-02 15:49:38

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; char a[151]; char b[151]; int main(){ int c=0,d=0; cin>>a>>b; for(int i=0;a[i]!='\0';i++){ c=c+1; } for(int i=0;b[i]!='\0';i++){ d=d+1; } if(c==d){ cout<<"yes"; }else{ cout<<"no"; } return 0; } #include<bits/stdc++.h> using namespace std; char a[151]; char b[151]; int main(){ int c=0,d=0; cin>>a>>b; for(int i=0;a[i]!='\0';i++){ c=c+1; } for(int i=0;b[i]!='\0';i++){ d=d+1; } if(c==d){ cout<<"yes"; }else{ cout<<"no"; } return 0; }


Run Info:

Main.cc:28:11: error: redefinition of 'char a [151]'
 char a[151];
           ^
Main.cc:3:6: note: 'char a [151]' previously declared here
 char a[151];
      ^
Main.cc:29:11: error: redefinition of 'char b [151]'
 char b[151];
           ^
Main.cc:4:6: note: 'char b [151]' previously declared here
 char b[151];
      ^
Main.cc: In function 'int main()':
Main.cc:30:5: error: redefinition of 'int main()'
 int main(){
     ^
Main.cc:5:5: note: 'int main()' previously defined here
 int main(){
     ^