Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
124771 晏莞煜 字符串长度判断 C++ Compile Error 0 MS 0 KB 447 2025-07-12 14:46:55

Tests(0/0):


Code:

#include<iostream> #include<cmath> using namespace std; int main(){ //char a[5]={"abcd"}; /** 1:char a[100]; for(int i=0;i<100;i++){ a[i]=getchar() } 2: char a[100]; cin>>a; cout<<a; 3: scanf("%s",a); printf("%s",a); //求长度 int l=strlen(a); cout<<l; **/ char a[150],b[150]; cin>>a>>b; int q=strlen(a),w=strlen(b); if(q==w){ cout<<"yes"; }else{ cout<<"no"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:28:16: error: 'strlen' was not declared in this scope
  int q=strlen(a),w=strlen(b);
                ^
Main.cc:29:8: error: 'w' was not declared in this scope
  if(q==w){
        ^