Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:8:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<s.size();i++)
              ~^~~~~~~~~
/in/foo.cc:15:13: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int')
  cout<<sum1=sum2;
             ^~~~
In file included from /usr/include/c++/6/istream:39:0,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/ostream:402:7: note: candidate: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]
       operator=(basic_ostream&& __rhs)
       ^~~~~~~~
/usr/include/c++/6/ostream:402:7: note:   no known conversion for argument 1 from 'int' to 'std::basic_ostream<char>&&'

信息

递交者
类型
递交
题目
P1013 字符统计
语言
C++
递交时间
2024-05-20 22:19:57
评测时间
2024-05-21 16:20:29
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes