Language: C++

#include<iostream>
#include<stdio.h>

using namespace std;

int main()
{ string S; cin >> S;
 int c = S.size() - 2;
 string d = stoi(c);
 cout << S.front() + d + S.back << endl;
 return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: no matching function for call to 'stoi(int&)'
    9 |  string d = stoi(c);
      |             ~~~~^~~
In file included from /usr/include/c++/14/string:54,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from 'int' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from 'int' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
a.cc:10:24: error: no match for 'operator+' (operand types are 'std::__cxx11::basic_string<char>' and '<unresolved overloaded function type>')
   10 |  cout << S.front() + d + S.back << endl;
      |          ~~~~~~~~~~~~~ ^ ~~~~~~
      |                    |       |
      |                    |       <unresolved overloaded function type>
      |                    std::__cxx11::basic_string<char>
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
  627 |     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note:   template argument deduction/substitution failed:
a.cc:10:28: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'const __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type& (std::__cxx11::basic_string<char>::*)() const noexcept' {aka 'const char& (std::__cxx11::basic_string<char>::*)() const noexcept'}
   10 |  cout << S.front() + d + S.back << endl;
      |                            ^~~~
a.cc:10:28: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type& (std::__cxx11::basic_string<char>::*)() noexcept' {aka 'char& (std::__cxx11::basic_string<char>::*)() noexcept'}
a.cc:10:28: note:   couldn't deduce template parameter '_Iterator'
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
 1798 |     operator+(typename move_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note:   template argument deduction/substitution failed:
a.cc:10:28: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'const __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type& (std::__cxx11::basic_string<char>::*)() const noexcept' {aka 'const char& (std::__cxx11::basic_string<char>::*)() const noexcept'}
   10 |  cout << S.front() + d + S.back << endl;
      |                            ^~~~
a.cc:10:28: note:   mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type& (std::__cxx11::basic_string<char>::*)() noexcept' {aka 'char& (std::__cxx11::basic_string<char>::*)() noexcept'}
a.cc:10:28: note:   couldn't deduce template parameter '_Iterator'
/usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]'
 3598 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3599:60: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const std::__cxx11::basic_string<char>&'
 3599 |               const basic_string<_CharT, _Traits, _Alloc>& __rhs)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3616 |     operator+(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note:   template argument deduction/substitution failed:
a.cc:10:28: note:   mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
   10 |  cout << S.front() + d + S.back << endl;
      |                            ^~~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3635 |     operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note:   template argument deduction/substitution failed:
a.cc:10:28: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'const __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type& (std::__cxx11::basic_string<char>::*)() const noexcept' {aka 'const char& (std::__cxx11::basic_string<char>::*)() const noexcept'}
   10 |  cout << S.front() + d + S.back << endl;
      |                            ^~~~
a.cc:10:28: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type& (std::__cxx11::basic_string<char>::*)() noexcept' {aka 'char& (std::__cxx11::basic_string<char>::*)() noexcept'}
a.cc:10:28: note:   couldn't deduce template parameter '_Traits'
/usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]'
 3652 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3653:29: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const char*'
 3653 |               const _CharT* __rhs)
      |               ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]'
 3670 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3670:74: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to 'char'
 3670 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
      |                                                                   ~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]'
 3682 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3683:60: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const std::__cxx11::basic_string<char>&'
 3683 |               const basic_string<_CharT, _Traits, _Alloc>& __rhs)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]'
 3689 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3690:55: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to 'std::__cxx11::basic_string<char>&&'
 3690 |               basic_string<_CharT, _Traits, _Alloc>&& __rhs)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]'
 3696 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3697:55: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to 'std: