Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    map<char,char> mp;
    mp["A"]="T";mp["T"]="A",mp["C"]="G",mp["G"]="C";
    char s;
    cin >> s;
    cout << mp[s];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, char>' and 'const char [2]')
    6 |     mp["A"]="T";mp["T"]="A",mp["C"]="G",mp["G"]="C";
      |       ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/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 = char; _Tp = char; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, char> >; mapped_type = char; key_type = char]' (near match)
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:7: note:   conversion of argument 1 would be ill-formed:
a.cc:6:8: error: invalid conversion from 'const char*' to 'std::map<char, char>::key_type' {aka 'char'} [-fpermissive]
    6 |     mp["A"]="T";mp["T"]="A",mp["C"]="G",mp["G"]="C";
      |        ^~~
      |        |
      |        const char*
/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 = char; _Tp = char; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, char> >; mapped_type = char; key_type = char]' (near match)
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:7: note:   conversion of argument 1 would be ill-formed:
a.cc:6:8: error: invalid conversion from 'const char*' to 'std::map<char, char>::key_type' {aka 'char'} [-fpermissive]
    6 |     mp["A"]="T";mp["T"]="A",mp["C"]="G",mp["G"]="C";
      |        ^~~
      |        |
      |        const char*
a.cc:6:19: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, char>' and 'const char [2]')
    6 |     mp["A"]="T";mp["T"]="A",mp["C"]="G",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 = char; _Tp = char; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, char> >; mapped_type = char; key_type = char]' (near match)
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:7: note:   conversion of argument 1 would be ill-formed:
a.cc:6:20: error: invalid conversion from 'const char*' to 'std::map<char, char>::key_type' {aka 'char'} [-fpermissive]
    6 |     mp["A"]="T";mp["T"]="A",mp["C"]="G",mp["G"]="C";
      |                    ^~~
      |                    |
      |                    const char*
/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 = char; _Tp = char; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, char> >; mapped_type = char; key_type = char]' (near match)
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:7: note:   conversion of argument 1 would be ill-formed:
a.cc:6:20: error: invalid conversion from 'const char*' to 'std::map<char, char>::key_type' {aka 'char'} [-fpermissive]
    6 |     mp["A"]="T";mp["T"]="A",mp["C"]="G",mp["G"]="C";
      |                    ^~~
      |                    |
      |                    const char*
a.cc:6:31: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, char>' and 'const char [2]')
    6 |     mp["A"]="T";mp["T"]="A",mp["C"]="G",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 = char; _Tp = char; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, char> >; mapped_type = char; key_type = char]' (near match)
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:7: note:   conversion of argument 1 would be ill-formed:
a.cc:6:32: error: invalid conversion from 'const char*' to 'std::map<char, char>::key_type' {aka 'char'} [-fpermissive]
    6 |     mp["A"]="T";mp["T"]="A",mp["C"]="G",mp["G"]="C";
      |                                ^~~
      |                                |
      |                                const char*
/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 = char; _Tp = char; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, char> >; mapped_type = char; key_type = char]' (near match)
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:7: note:   conversion of argument 1 would be ill-formed:
a.cc:6:32: error: invalid conversion from 'const char*' to 'std::map<char, char>::key_type' {aka 'char'} [-fpermissive]
    6 |     mp["A"]="T";mp["T"]="A",mp["C"]="G",mp["G"]="C";
      |                                ^~~
      |                                |
      |                                const char*
a.cc:6:43: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, char>' and 'const char [2]')
    6 |     mp["A"]="T";mp["T"]="A",mp["C"]="G",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 = char; _Tp = char; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, char> >; mapped_type = char; key_type = char]' (near match)
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:7: note:   conversion of argument 1 would be ill-formed:
a.cc:6:44: error: invalid conversion from 'const char*' to 'std::map<char, char>::key_type' {aka 'char'} [-fpermissive]
    6 |     mp["A"]="T";mp["T"]="A",mp["C"]="G",mp["G"]="C";
      |                                            ^~~
      |                                            |
      |                                            const char*
/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 = char; _Tp = char; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, char> >; mapped_type = char; key_type = char]' (near match)
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:7: note:   conversion of argument 1 would be ill-formed:
a.cc:6:44: error: invalid conversion from 'const char*' to 'std::map<char, char>::key_type' {aka 'char'} [-fpermissive]
    6 |     mp["A"]="T";mp["T"]="A",mp["C"]="G",mp["G"]="C";
      |                                            ^~~
      |                                            |
      |                                            const char*