Compile Error

foo.cc: In function 'int main()':
foo.cc:9:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |  for(int i=0;i<s.size();i++)
      |              ~^~~~~~~~~
foo.cc:13:9: error: expected ';' before 'for'
   13 |    cnt++
      |         ^
      |         ;
   14 |    for(int j=i+1;j<s.size();j++)
      |    ~~~   
foo.cc:14:18: error: 'j' was not declared in this scope
   14 |    for(int j=i+1;j<s.size();j++)
      |                  ^
foo.cc:18:18: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]' (did you forget the '()' ?)
   18 |  for(int i=0;i<s.size-cnt;i++)
      |                ~~^~~~
      |                      ()
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1079 A8-5 删除字符串中多余的一种字符
语言
C++
递交时间
2022-02-14 13:20:45
评测时间
2022-02-14 13:20:45
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes