Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:6:13: warning: right operand of comma operator has no effect [-Wunused-value]
    6 |     cin>>V,G;
      |             ^
/in/foo.cc:9:12: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>' and 'double')
    9 |     cout<<M==0.5*V)
      |     ~~~~~~~^~~~~~~
      |         |       |
      |         |       double
      |         std::basic_ostream<char>
/in/foo.cc:9:12: note: candidate: 'operator==(int, double)' (built-in)
    9 |     cout<<M==0.5*V)
      |     ~~~~~~~^~~~~~~
/in/foo.cc:9:12: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/c++/12/regex:66,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:110,
                 from /in/foo.cc:1:
/usr/include/c++/12/bits/regex.h:1063:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
 1063 |     operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1063:5: note:   template argument deduction/substitution failed:
/in/foo.cc:9:18: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
    9 |     cout<<M==0.5*V)
      |                  ^
/usr/include/c++/12/bits/regex.h:1159:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
 1159 |     operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1159:5: note:   template argument deduction/substitution failed:
/in/foo.cc:9:18: note:   'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
    9 |     cout<<M==0.5*V)
      |                  ^
/usr/include/c++/12/bits/regex.h:1234:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
 1234 |     operator==(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1234:5: note:   template argument deduction/substitution failed:
/in/foo.cc:9:18: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
    9 |     cout<<M==0.5*V)
      |                  ^
/usr/include/c++/12/bits/regex.h:1326:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
 1326 |     operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1326:5: note:   template argument deduction/substitution failed:
/in/foo.cc:9:18: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'double'
    9 |     cout<<M==0.5*V)
      |                  ^
/usr/include/c++/12/bits/regex.h:1401:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
 1401 |     operator==(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1401:5: note:   template argument deduction/substitution failed:
/in/foo.cc:9:18: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
    9 |     cout<<M==0.5*V)
      |                  ^
/usr/include/c++/12/bits/regex.h:1494:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
 1494 |     operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1494:5: note:   template argument deduction/substitution failed:
/in/foo.cc:9:18: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'double'
    9 |     cout<<M==0.5*V)
      |                  ^
/usr/include/c++/12/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
 1573 |     operator==(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1573:5: note:   template argument deduction/substitution failed:
/in/foo.cc:9:18: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
    9 |     cout<<M==0.5*V)
      |                  ^
/usr/include/c++/12/bits/regex.h:2131:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
 2131 |     operator==(const match_results<_Bi_iter, _Alloc>& __m1,
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:2131:5: note:   template argument deduction/substitution failed:
/in/foo.cc:9:18: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
    9 |     cout<<M==0.5*V)
      |                  ^
In file included from /usr/include/c++/12/iosfwd:40,
                 from /usr/include/c++/12/ios:38,
                 from /usr/include/c++/12/istream:38,
                 from /usr/include/c++/12/sstream:38,
                 from /usr/include/c++/12/complex:45,
                 from /usr/include/c++/12/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:54:
/usr/include/c++/12/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
  192 |     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/12/bits/postypes.h:192:5: note:   template argument deduction/substitution failed:
/in/foo.cc:9:18: note:   'std::basic_ostream<char>' is not derived from 'const std::fpos<_StateT>'
    9 |     cout<<M==0.5*V)
      |                  ^
In file included from /usr/include/c++/12/string:41,
                 from /usr/include/c++/12/bits/locale_classes.h:40,
                 from /usr/include/c++/12/bits/ios_base.h:41,
                 from /usr/include/c++/12/ios:42:
/usr/include/c++/12/bits/allocator.h:219:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
  219 |     operator==(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/include/c++/12/bits/allocator.h:219:5: note:   template argument deduction/substitution failed:
/in/foo.cc:9:18: note:   'std::basic_ostream<char>' is not derived from 'const std::allocator<_CharT>'
    9 |     cout<<M==0.5*V)
      |                  ^
In file included from /usr/include/c++/12/string:47:
/usr/include/c++/12/bits/stl_iterator.h:444:5: note: candidate: 'template<class _Iterator> bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  444 |     operator==(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:444:5: note:   template argument deduction/substitution failed:
/in/foo.cc:9:18: note:   'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
    9 |     cout<<M==0.5*V)
      |                  ^
/usr/include/c++/12/bits/stl_iterator.h:489:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  489 |     operator==(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:489:5: note:   template argument deduction/substitution failed:
/in/foo.cc:9:18: note:   'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
    9 |     cout<<M==0.5*V)
      |                  ^
/usr/include/c++/12/bits/stl_iterator.h:16

信息

递交者
类型
递交
题目
P3008 小杨的爱心快递 202512GESP1级T1
比赛
2026.1.10初级班结业测试
语言
C++
递交时间
2026-01-10 09:22:00
评测时间
2026-01-10 09:22:00
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes