Compile Error

foo.cc: In function 'int main()':
foo.cc:39:5: error: reference to 'count' is ambiguous
   39 |     count++;
      |     ^~~~~
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_algo.h:4107:5: note: candidates are: 'template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4107 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
foo.cc:3:7: note:                 'int count'
    3 | int n,count=0;
      |       ^~~~~
foo.cc:43:5: error: reference to 'count' is ambiguous
   43 |  if(count==0)
      |     ^~~~~
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_algo.h:4107:5: note: candidates are: 'template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4107 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
foo.cc:3:7: note:                 'int count'
    3 | int n,count=0;
      |       ^~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1162 马鞍点
语言
C++
递交时间
2022-01-16 16:54:17
评测时间
2022-01-16 16:54:17
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes