Compile Error

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)提供评测服务

信息

递交者
类型
递交
题目
P1103 字符统计
语言
C++
递交时间
2022-07-19 18:08:11
评测时间
2022-07-19 18:08:24
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes