/ MYOJ /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:12:3: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
   gets(s1);
   ^~~~
In file included from /usr/include/c++/6/cstdio:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:46,
                 from /in/foo.cc:1:
/usr/include/stdio.h:640:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
/in/foo.cc:12:10: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
   gets(s1);
          ^
In file included from /usr/include/c++/6/cstdio:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:46,
                 from /in/foo.cc:1:
/usr/include/stdio.h:640:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
/in/foo.cc:12:10: error: cannot convert 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' to 'char*' for argument '1' to 'char* gets(char*)'
   gets(s1);
          ^
/in/foo.cc:13:17: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
                 gets(s2);
                 ^~~~
In file included from /usr/include/c++/6/cstdio:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:46,
                 from /in/foo.cc:1:
/usr/include/stdio.h:640:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
/in/foo.cc:13:24: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
                 gets(s2);
                        ^
In file included from /usr/include/c++/6/cstdio:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:46,
                 from /in/foo.cc:1:
/usr/include/stdio.h:640:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
/in/foo.cc:13:24: error: cannot convert 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' to 'char*' for argument '1' to 'char* gets(char*)'
                 gets(s2);
                        ^

信息

递交者
类型
递交
题目
P1005 史上最简单的问题
语言
C++
递交时间
2021-02-28 20:44:43
评测时间
2021-02-28 20:44:43
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes