foo.cc: In function 'int main()':
foo.cc:42:35: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
42 | scanf("%d%d", &n, &m); gets(laji);
| ^
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/9/cstdio:42,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:46,
from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
235 | gets (char *__str)
| ^~~~
foo.cc:42:35: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
42 | scanf("%d%d", &n, &m); gets(laji);
| ^
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/9/cstdio:42,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:46,
from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
235 | gets (char *__str)
| ^~~~
foo.cc:46:10: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
46 | gets(s);
| ^
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/9/cstdio:42,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:46,
from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
235 | gets (char *__str)
| ^~~~
foo.cc:46:10: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
46 | gets(s);
| ^
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/9/cstdio:42,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:46,
from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
235 | gets (char *__str)
| ^~~~
foo.cc:47:8: warning: unused variable 'l' [-Wunused-variable]
47 | int l = strlen(s);
| ^
foo.cc:42:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
42 | scanf("%d%d", &n, &m); gets(laji);
| ~~~~~^~~~~~~~~~~~~~~~
foo.cc:42:30: warning: ignoring return value of 'char* gets(char*)', declared with attribute warn_unused_result [-Wunused-result]
42 | scanf("%d%d", &n, &m); gets(laji);
| ~~~~^~~~~~
foo.cc:46:8: warning: ignoring return value of 'char* gets(char*)', declared with attribute warn_unused_result [-Wunused-result]
46 | gets(s);
| ~~~~^~~
/usr/bin/ld: /tmp/ccg4YLnO.o: in function `main':
foo.cc:(.text.startup+0x5b): warning: the `gets' function is dangerous and should not be used.
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务