Compile Error

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

信息

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