foo.cc: In function 'int main()':
foo.cc:176:7: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
176 | gets(word);//只有加这一句,才能正确读证词
| ~~~~^~~~~~
In file included from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/cstdio:42,
from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/ext/string_conversions.h:43,
from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/bits/basic_string.h:3968,
from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/string:53,
from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/bits/locale_classes.h:40,
from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/bits/ios_base.h:41,
from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/ios:42,
from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/ostream:38,
from iostream:39:
/nix/store/3w4yrspgcx1z9wi18rv0hbap4jjlhx4c-glibc-2.37-8-dev/include/stdio.h:605:14: note: declared here
605 | extern char *gets (char *__s) __wur __attribute_deprecated__;
| ^~~~
foo.cc:179:21: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
179 | string temp=gets(word);
| ~~~~^~~~~~
/nix/store/3w4yrspgcx1z9wi18rv0hbap4jjlhx4c-glibc-2.37-8-dev/include/stdio.h:605:14: note: declared here
605 | extern char *gets (char *__s) __wur __attribute_deprecated__;
| ^~~~
foo.cc:170:11: warning: 'index' may be used uninitialized [-Wmaybe-uninitialized]
170 | int i,j,index,BadManNum=0;
| ^~~~~
/nix/store/j2gmfdd29cp3rcvghmn1a5kgcnmf8myp-binutils-2.40/bin/ld: /tmp/ccKuyKuj.o: in function `main':
foo.cc:(.text.startup+0xba): warning: the `gets' function is dangerous and should not be used.
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务