Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
136196 林睿 字符倒序 C++ Compile Error 0 MS 0 KB 158 2025-11-09 17:41:04

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ char a[101]; gets(a); for(int i=strlen(s)-1;i>=0;i--) { cout<<a[i]; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:5: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:5: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:5: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:6:19: error: 's' was not declared in this scope
  for(int i=strlen(s)-1;i>=0;i--)
                   ^
Main.cc:5:9: warning: ignoring return value of 'char* gets(char*)', declared with attribute warn_unused_result [-Wunused-result]
  gets(a);
         ^