Language: C++

#include <iostream>
#include <string>
#include <iomanip>
#include <unordered_map>
#include <math.h>

using namespace std;

int main(){
	
	
		
		int n;
		std::unordered_map<string,int> freq;
    cin>>n;
    int temp;
    for(int i = 0; i < n; i++)
    {
        cin>>temp;
        if (temp != freq.end()) {
			temp->second++;	// increment map's value for key 'c'
		}
		// key not found
		else {
			freq.insert(std::make_pair(c, 1));
		}
    }
		cout << temp;
	
	
	
	
	return 0;
	
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:18: error: no match for 'operator!=' (operand types are 'int' and 'std::unordered_map<std::__cxx11::basic_string<char>, int>::iterator' {aka 'std::__detail::_Insert_base<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char> >, std::hash<std::__cxx11::basic_string<char> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::iterator'})
   20 |         if (temp != freq.end()) {
      |             ~~~~ ^~ ~~~~~~~~~~
      |             |               |
      |             int             std::unordered_map<std::__cxx11::basic_string<char>, int>::iterator {aka std::__detail::_Insert_base<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char> >, std::hash<std::__cxx11::basic_string<char> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::iterator}
In file included from /usr/include/c++/14/bits/hashtable.h:35,
                 from /usr/include/c++/14/bits/unordered_map.h:33,
                 from /usr/include/c++/14/unordered_map:41,
                 from a.cc:4:
/usr/include/c++/14/bits/hashtable_policy.h:413:7: note: candidate: 'bool std::__detail::operator!=(const _Node_iterator_base<std::pair<const std::__cxx11::basic_string<char>, int>, true>&, const _Node_iterator_base<std::pair<const std::__cxx11::basic_string<char>, int>, true>&)' (near match)
  413 |       operator!=(const _Node_iterator_base& __x, const _Node_iterator_base& __y)
      |       ^~~~~~~~
/usr/include/c++/14/bits/hashtable_policy.h:413:7: note:   conversion of argument 1 would be ill-formed:
a.cc:20:13: error: invalid user-defined conversion from 'int' to 'const std::__detail::_Node_iterator_base<std::pair<const std::__cxx11::basic_string<char>, int>, true>&' [-fpermissive]
   20 |         if (temp != freq.end()) {
      |             ^~~~
/usr/include/c++/14/bits/hashtable_policy.h:399:7: note: candidate is: 'std::__detail::_Node_iterator_base<_Value, _Cache_hash_code>::_Node_iterator_base(__node_type*) [with _Value = std::pair<const std::__cxx11::basic_string<char>, int>; bool _Cache_hash_code = true; __node_type = std::__detail::_Node_iterator_base<std::pair<const std::__cxx11::basic_string<char>, int>, true>::__node_type]' (near match)
  399 |       _Node_iterator_base(__node_type* __p) noexcept
      |       ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/hashtable_policy.h:399:7: note:   conversion of argument 1 would be ill-formed:
a.cc:20:13: error: invalid conversion from 'int' to 'std::__detail::_Node_iterator_base<std::pair<const std::__cxx11::basic_string<char>, int>, true>::__node_type*' [-fpermissive]
   20 |         if (temp != freq.end()) {
      |             ^~~~
      |             |
      |             int
a.cc:20:13: error: invalid conversion from 'int' to 'std::__detail::_Node_iterator_base<std::pair<const std::__cxx11::basic_string<char>, int>, true>::__node_type*' [-fpermissive]
   20 |         if (temp != freq.end()) {
      |             ^~~~
      |             |
      |             int
/usr/include/c++/14/bits/hashtable_policy.h:399:40: note:   initializing argument 1 of 'std::__detail::_Node_iterator_base<_Value, _Cache_hash_code>::_Node_iterator_base(__node_type*) [with _Value = std::pair<const std::__cxx11::basic_string<char>, int>; bool _Cache_hash_code = true; __node_type = std::__detail::_Node_iterator_base<std::pair<const std::__cxx11::basic_string<char>, int>, true>::__node_type]'
  399 |       _Node_iterator_base(__node_type* __p) noexcept
      |                           ~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/iosfwd:42,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/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++/14/bits/postypes.h:197:5: note:   template argument deduction/substitution failed:
a.cc:20:30: note:   mismatched types 'const std::fpos<_StateT>' and 'int'
   20 |         if (temp != freq.end()) {
      |                              ^
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)'
  243 |     operator!=(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:243:5: note:   template argument deduction/substitution failed:
a.cc:20:30: note:   mismatched types 'const std::allocator<_CharT>' and 'int'
   20 |         if (temp != freq.end()) {
      |                              ^
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  455 |     operator!=(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:455:5: note:   template argument deduction/substitution failed:
a.cc:20:30: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   20 |         if (temp != freq.end()) {
      |                              ^
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  500 |     operator!=(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note:   template argument deduction/substitution failed:
a.cc:20:30: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   20 |         if (temp != freq.end()) {
      |                              ^
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1686 |     operator!=(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note:   template argument deduction/substitution failed:
a.cc:20:30: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
   20 |         if (temp != freq.end()) {
      |                              ^
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1753 |     operator!=(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note:   template argument deduction/substitution failed:
a.cc:20:30: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
   20 |         if (temp != freq.end()) {
      |                              ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
 1052 |     operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1052:5: note:   template argument deduction/substitution failed:
a.cc:20:30: note:   mismatched types 'const std::pair<_T1, _T2>' and 'int'
   20 |         if (temp != freq.end()) {
      |                              ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
                 from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
  651 |     operator!=(basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/include/c++/14/string_view:651:5: note:   template argument deduction/substitution failed:
a.cc:20:30: note:   mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
   20 |         if (temp != freq.end()) {
      |                              ^
/usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
  658 |     operator!=(basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/include/c++/14/string_view:658:5: note:   template argument deduction/substitution failed:
a.cc:20:30: note:   mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
   20 |         if (temp != freq.end()) {
      |                              ^
/usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
  666 |     operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
      |     ^~~~~~~~
/usr/include/c++/14/string_view:666:5: note:   template argument deduction/substitution failed:
a.cc:20:30: note:   'std::__detail::_Node_iterator<std::pair<const st