Language: C++

#include<iostream>
#include<map>
int main()
{
  std::map<char, int> M;
  int k;
  string S = "abcde";
  std::cin >> M["a"];
  std::cin >> M["b"];
  std::cin >> M["c"];
  std::cin >> M["d"];
  std::cin >> M["e"];
  std::cint >> k;
  for(char key : S){
    for(char  key_t : S){
      if(std::abs(M[key] - M[key_t]) > k){
        std::cout << ":(" << std::endl;
        break;
      }
    }
  }
  std::cout << "Yay!" << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string S = "abcde";
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 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/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included 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/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:16: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, int>' and 'const char [2]')
    8 |   std::cin >> M["a"];
      |                ^
In file included from /usr/include/c++/14/map:63,
                 from a.cc:2:
/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 = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; 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:8:17: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
    8 |   std::cin >> M["a"];
      |                 ^~~
      |                 |
      |                 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 = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; 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:8:17: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
    8 |   std::cin >> M["a"];
      |                 ^~~
      |                 |
      |                 const char*
a.cc:9:16: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, int>' and 'const char [2]')
    9 |   std::cin >> M["b"];
      |                ^
/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 = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; 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:9:17: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
    9 |   std::cin >> M["b"];
      |                 ^~~
      |                 |
      |                 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 = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; 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:9:17: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
    9 |   std::cin >> M["b"];
      |                 ^~~
      |                 |
      |                 const char*
a.cc:10:16: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, int>' and 'const char [2]')
   10 |   std::cin >> M["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 = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; 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:10:17: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   10 |   std::cin >> M["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 = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; 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:10:17: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   10 |   std::cin >> M["c"];
      |                 ^~~
      |                 |
      |                 const char*
a.cc:11:16: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, int>' and 'const char [2]')
   11 |   std::cin >> M["d"];
      |                ^
/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 = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; 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:11:17: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   11 |   std::cin >> M["d"];
      |                 ^~~
      |                 |
      |                 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 = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; 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:11:17: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   11 |   std::cin >> M["d"];
      |                 ^~~
      |                 |
      |                 const char*
a.cc:12:16: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, int>' and 'const char [2]')
   12 |   std::cin >> M["e"];
      |                ^
/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 = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; 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:12:17: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   12 |   std::cin >> M["e"];
      |                 ^~~
      |                 |
      |                 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 = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; 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:12:17: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   12 |   std::cin >> M["e"];
      |                 ^~~
      |                 |
      |                 const char*
a.cc:13:8: error: 'cint' is not a member of 'std'; did you mean 'cin'?
   13 |   std::cint >> k;
      |        ^~~~
      |        cin
a.cc:14:18: error: 'S' was not declared in this scope
   14 |   for(char key : S){
      |                  ^