记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:8:16: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
    8 |         while(b!=0){
      |               ~^~~
      |               |  |
      |               |  int
      |               std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/12/iosfwd:40,
                 from /usr/include/c++/12/ios:38,
                 from /usr/include/c++/12/ostream:38,
                 from /usr/include/c++/12/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/12/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)'
  197 |     operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/12/bits/postypes.h:197:5: note:   template argument deduction/substitution failed:
/in/foo.cc:8:18: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
    8 |         while(b!=0){
      |                  ^
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:226:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)'
  226 |     operator!=(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/include/c++/12/bits/allocator.h:226:5: note:   template argument deduction/substitution failed:
/in/foo.cc:8:18: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
    8 |         while(b!=0){
      |                  ^
In file included from /usr/include/c++/12/string:47:
/usr/include/c++/12/bits/stl_iterator.h:458:5: note: candidate: 'template<class _Iterator> bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  458 |     operator!=(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:458:5: note:   template argument deduction/substitution failed:
/in/foo.cc:8:18: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
    8 |         while(b!=0){
      |                  ^
/usr/include/c++/12/bits/stl_iterator.h:503:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  503 |     operator!=(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:503:5: note:   template argument deduction/substitution failed:
/in/foo.cc:8:18: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
    8 |         while(b!=0){
      |                  ^
/usr/include/c++/12/bits/stl_iterator.h:1675:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1675 |     operator!=(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:1675:5: note:   template argument deduction/substitution failed:
/in/foo.cc:8:18: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
    8 |         while(b!=0){
      |                  ^
/usr/include/c++/12/bits/stl_iterator.h:1741:5: note: candidate: 'template<class _Iterator> bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1741 |     operator!=(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:1741:5: note:   template argument deduction/substitution failed:
/in/foo.cc:8:18: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
    8 |         while(b!=0){
      |                  ^
In file included from /usr/include/c++/12/bits/stl_algobase.h:64,
                 from /usr/include/c++/12/string:50:
/usr/include/c++/12/bits/stl_pair.h:670:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
  670 |     operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_pair.h:670:5: note:   template argument deduction/substitution failed:
/in/foo.cc:8:18: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
    8 |         while(b!=0){
      |                  ^
In file included from /usr/include/c++/12/string:53:
/usr/include/c++/12/bits/basic_string.h:3653:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3653 |     operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/basic_string.h:3653:5: note:   template argument deduction/substitution failed:
/in/foo.cc:8:18: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int'
    8 |         while(b!=0){
      |                  ^
/usr/include/c++/12/bits/basic_string.h:3666:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3666 |     operator!=(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/basic_string.h:3666:5: note:   template argument deduction/substitution failed:
/in/foo.cc:8:18: note:   mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
    8 |         while(b!=0){
      |                  ^
/usr/include/c++/12/bits/basic_string.h:3678:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)'
 3678 |     operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/basic_string.h:3678:5: note:   template argument deduction/substitution failed:
/in/foo.cc:8:18: note:   mismatched types 'const _CharT*' and 'int'
    8 |         while(b!=0){
      |                  ^
In file included from /usr/include/c++/12/bits/locale_facets.h:48,
                 from /usr/include/c++/12/bits/basic_ios.h:37,
                 from /usr/include/c++/12/ios:44:
/usr/include/c++/12/bits/streambuf_iterator.h:241:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)'
  241 |     operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
      |     ^~~~~~~~
/usr/include/c++/12/bits/streambuf_iterator.h:241:5: note:   template argument deduction/substitution failed:
/in/foo.cc:8:18: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>'
    8 |         while(b!=0){
      |                  ^
In file included from /usr/include/x86_64-linux-gnu/c++/12/bits/c++allocator.h:33,
                 from /usr/include/c++/12/bits/allocator.h:46:
/usr/include/c++/12/bits/new_allocator.h:203:9: note: candidate: 'template<class _Up> bool std::operator!=(const __new_allocator<char>&, const __new_allocator<_Tp>&)'
  203 |         operator!=(const __new_allocator&, const __new_allocator<_Up>&)
      |         ^~~~~~~~
/usr/include/c++/12/bits/new_allocator.h:203:9: note:   template argument deduction/substitution failed:
/in/foo.cc:8:18: note:   mismatched types 'const std::__new_allocator<_Tp>' and 'int'
    8 |         while(b!=0){
      |                  ^
In file included from /usr/incl

信息

递交者
类型
自测
题目
P1003 最小公倍数
语言
C++
递交时间
2026-11-15 20:06:24
评测时间
2026-11-15 20:06:24
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes