Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
98327 Kevin 31忽略大小写的字符串比较 C++ Compile Error 0 MS 0 KB 445 2024-11-19 14:18:10

Tests(0/0):


Code:

#include<bits/stdc++.h> #include<cstdio> using namespace std; int main(){ char a[100],b[100],c[100],d[100]; int l1=0,l2=0; gets(a); gets(b); strlwr(a); strlwr(b); for(int i=0;i<strlen(a);i++) { if(a[i]!=' ') c[l1++]=a[i]; } for(int i=0;i<strlen(b);i++) { if(b[i]!=' ') d[l2++]=b[i]; } if(strcmp(c,d)>0) { cout<<">"; } else if(strcmp(c,d)==0) { cout<<"="; } else cout<<"<"; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7: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:7: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:7:8: 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:8: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:8: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:8:8: 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:9:10: error: 'strlwr' was not declared in this scope
  strlwr(a);
          ^
Main.cc:11:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i