Compile Error

foo.cc: In function 'int main()':
foo.cc:10:8: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
   10 |  gets(a);
      |        ^
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from foo.cc:2:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
  235 | gets (char *__str)
      | ^~~~
foo.cc:10:8: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
   10 |  gets(a);
      |        ^
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from foo.cc:2:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
  235 | gets (char *__str)
      | ^~~~
foo.cc:22:2: error: 'cout' was not declared in this scope
   22 |  cout<<a;
      |  ^~~~
foo.cc:4:1: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
    3 | #include <cstring>
  +++ |+#include <iostream>
    4 | using namespace std;
foo.cc:10:6: warning: ignoring return value of 'char* gets(char*)', declared with attribute warn_unused_result [-Wunused-result]
   10 |  gets(a);
      |  ~~~~^~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1079 删除指定字符
语言
C++
递交时间
2021-12-18 13:22:50
评测时间
2021-12-18 13:22:50
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes