Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
98335 Kevin 字符串长度判断 C++ Compile Error 0 MS 0 KB 237 2024-11-19 15:14:32

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; const n=150; char a[n],b[n]; int main(){ gets(a); gets(b); int len1=strlen(a); int len2=strlen(b); if(len1==len2){ cout<<"yes"; } else cout<<"no"; return 0; }


Run Info:

Main.cc:3:7: error: 'n' does not name a type
 const n=150;
       ^
Main.cc:4:8: error: 'n' was not declared in this scope
 char a[n],b[n]; 
        ^
Main.cc:4:13: error: 'n' was not declared in this scope
 char a[n],b[n]; 
             ^
Main.cc: In function 'int main()':
Main.cc:6:2: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
  gets(a);
  ^
In file included from /usr/include/c++/5/cstdio:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:46,
                 from Main.cc:1:
/usr/include/stdio.h:638:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^
Main.cc:6:2: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
  gets(a);
  ^
In file included from /usr/include/c++/5/cstdio:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:46,
                 from Main.cc:1:
/usr/include/stdio.h:638:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^
Main.cc:6:7: error: 'a' was not declared in this scope
  gets(a);
       ^
Main.cc:7:2: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
  gets(b);
  ^
In file included from /usr/include/c++/5/cstdio:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:46,
                 from Main.cc:1:
/usr/include/stdio.h:638:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^
Main.cc:7:2: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
  gets(b);
  ^
In file included from /usr/include/c++/5/cstdio:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:46,
                 from Main.cc:1:
/usr/include/stdio.h:638:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^
Main.cc:7:7: error: 'b' was not declared in this scope
  gets(b);
       ^