foo.cc:1:18: error: missing terminating > character
1 | #include<iostream
| ^
foo.cc: In function 'int main()':
foo.cc:5:13: error: conflicting declaration 'int s'
5 | int d,x,s,q,i;
| ^
foo.cc:4:10: note: previous declaration as 'char s [100]'
4 | char s[100];
| ^
foo.cc:6:11: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
6 | gets(s);
| ^
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/9/cstdio:42,
from /usr/include/c++/9/ext/string_conversions.h:43,
from /usr/include/c++/9/bits/basic_string.h:6496,
from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
235 | gets (char *__str)
| ^~~~
foo.cc:6:11: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
6 | gets(s);
| ^
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/9/cstdio:42,
from /usr/include/c++/9/ext/string_conversions.h:43,
from /usr/include/c++/9/bits/basic_string.h:6496,
from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
235 | gets (char *__str)
| ^~~~
foo.cc:7:13: error: incompatible types in assignment of 'int' to 'char [100]'
7 | d=x=s=q=0;
| ^
foo.cc:11:41: error: lvalue required as increment operand
11 | else if(s[i]>='0' && s[i]<='9')s++;
| ^~
foo.cc:13:19: warning: format '%d' expects argument of type 'int', but argument 4 has type 'char*' [-Wformat=]
13 | printf("%d %d %d %d\n",d,x,s,q);
| ~^ ~
| | |
| int char*
| %s
foo.cc:6:9: warning: ignoring return value of 'char* gets(char*)', declared with attribute warn_unused_result [-Wunused-result]
6 | gets(s);
| ~~~~^~~
[Hydro](https://hydro.ac)提供评测服务