Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
#include <map>
using namespace std;
int main()
{
    int a;
    cin >> a;
    map<string, string> mp;
    mp['A'] = 'T';
    mp['G'] = 'C';
    mp['T'] = 'A';
    mp['C'] = 'G';
    cout << mp[a] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >' and 'char')
   13 |     mp['A'] = 'T';
      |       ^
In file included from /usr/include/c++/14/map:63,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = std::__cxx11::basic_string<char>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'char' to 'const std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = std::__cxx11::basic_string<char>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'char' to 'std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:14:7: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >' and 'char')
   14 |     mp['G'] = 'C';
      |       ^
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = std::__cxx11::basic_string<char>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'char' to 'const std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = std::__cxx11::basic_string<char>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'char' to 'std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:15:7: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >' and 'char')
   15 |     mp['T'] = 'A';
      |       ^
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = std::__cxx11::basic_string<char>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'char' to 'const std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = std::__cxx11::basic_string<char>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'char' to 'std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:16:7: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >' and 'char')
   16 |     mp['C'] = 'G';
      |       ^
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = std::__cxx11::basic_string<char>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'char' to 'const std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = std::__cxx11::basic_string<char>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'char' to 'std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:17:15: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >' and 'int')
   17 |     cout << mp[a] << endl;
      |               ^
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = std::__cxx11::basic_string<char>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'int' to 'const std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = std::__cxx11::basic_string<char>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'int' to 'std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  524