foo.cc: In function 'int main(int, char**)':
foo.cc:4:29: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
4 | char s[101],i,j,k;gets(s);j=i=0;
| ^
In file included from /usr/include/stdio.h:867,
from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
235 | gets (char *__str)
| ^~~~
foo.cc:4:29: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
4 | char s[101],i,j,k;gets(s);j=i=0;
| ^
In file included from /usr/include/stdio.h:867,
from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
235 | gets (char *__str)
| ^~~~
foo.cc:5:14: warning: array subscript has type 'char' [-Wchar-subscripts]
5 | while(s[j++]=s[i++])if(s[j-1]=='*')j--;
| ~^~
foo.cc:5:21: warning: array subscript has type 'char' [-Wchar-subscripts]
5 | while(s[j++]=s[i++])if(s[j-1]=='*')j--;
| ~^~
foo.cc:5:17: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
5 | while(s[j++]=s[i++])if(s[j-1]=='*')j--;
| ~~~~~~^~~~~~~
foo.cc:4:21: warning: unused variable 'k' [-Wunused-variable]
4 | char s[101],i,j,k;gets(s);j=i=0;
| ^
foo.cc:4:27: warning: ignoring return value of 'char* gets(char*)', declared with attribute warn_unused_result [-Wunused-result]
4 | char s[101],i,j,k;gets(s);j=i=0;
| ~~~~^~~
/usr/bin/ld: /tmp/cc6kBVFE.o: in function `main':
foo.cc:(.text.startup+0x25): warning: the `gets' function is dangerous and should not be used.
[Hydro](https://hydro.ac)提供评测服务