Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
81546 刘慕莀 字符串长度判断 C++ Compile Error 0 MS 0 KB 317 2024-07-12 14:42:12

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:7: error: 'a_l' was not declared in this scope
       a_l++;
       ^
Main.cc:17:4: error: expected '(' before '[' token
  if[a_1==b_1]{
    ^
Main.cc:19:3: error: 'else' without a previous 'if'
  }else{
   ^
Main.cc:8:9: warning: unused variable 'a_1' [-Wunused-variable]
     int a_1=0;
         ^
Main.cc:9:9: warning: unused variable 'b_1' [-Wunused-variable]
     int b_1=0;
         ^