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)提供评测服务