foo.cc:1:18: error: missing terminating > character
1 | #include<iostream
| ^
foo.cc: In function 'int main()':
foo.cc:6:13: error: conflicting declaration 'int s'
6 | int d,x,s,q,i;
| ^
foo.cc:5:10: note: previous declaration as 'char s [100]'
5 | char s[100];
| ^
foo.cc:7:11: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
7 | 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:11: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
7 | 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:8:13: error: incompatible types in assignment of 'int' to 'char [100]'
8 | d=x=s=q=0;
| ^
foo.cc:12:41: error: lvalue required as increment operand
12 | else if(s[i]>='0' && s[i]<='9')s++;
| ^~
foo.cc:14:19: warning: format '%d' expects argument of type 'int', but argument 4 has type 'char*' [-Wformat=]
14 | printf("%d %d %d %d\n",d,x,s,q);
| ~^ ~
| | |
| int char*
| %s
foo.cc:7:9: warning: ignoring return value of 'char* gets(char*)', declared with attribute warn_unused_result [-Wunused-result]
7 | gets(s);
| ~~~~^~~
[Hydro](https://hydro.ac)提供评测服务