Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main(){
  string s;
  int n;
  cin >> s;
  n=s.size();
  bool can=true;
  string s1 = reverse(s.begin(),s.end());
  if(s == s1){
  }else{
    can  =false;
  }
  s1 = reverse(s.begin(),s.end());
  string s2 =reverse(s.begin(0),s.end((n-1)/2-1));
  string s3=reverse(s.begin((n+3)/2-1),s.end(n-1));
  bool can2=true;
  if(!can){
    cout << "No" << endl;
  }else{
    if(s==s2 && s==s3){
    }else{
      can2=false;
    }
  }
  
  if(can2) cout << "Yes" << endl;
  else cout << "No" << endl;
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: conversion from 'void' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   12 |   string s1 = reverse(s.begin(),s.end());
      |               ~~~~~~~^~~~~~~~~~~~~~~~~~~
a.cc:17:33: error: no match for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'void')
   17 |   s1 = reverse(s.begin(),s.end());
      |                                 ^
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:941:8: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  941 |        operator=(const _Tp& __svt)
      |        ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:941:8: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/basic_string.h: In substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = void; _Res = std::__cxx11::basic_string<char>&; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]':
/usr/include/c++/14/bits/basic_string.h:941:8:   required by substitution of 'template<class _Tp> std::__cxx11::basic_string<char>::_If_sv<_Tp, std::__cxx11::basic_string<char>&> std::__cxx11::basic_string<char>::operator=(const _Tp&) [with _Tp = void]'
a.cc:17:33:   required from here
   17 |   s1 = reverse(s.begin(),s.end());
      |                                 ^
/usr/include/c++/14/bits/basic_string.h:152:70: error: forming reference to void
  152 |                  __not_<is_convertible<const _Tp&, const _CharT*>>>::value,
      |                                                                      ^~~~~
/usr/include/c++/14/bits/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  817 |       operator=(const basic_string& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:817:37: note:   no known conversion for argument 1 from 'void' to 'const std::__cxx11::basic_string<char>&'
  817 |       operator=(const basic_string& __str)
      |                 ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  828 |       operator=(const _CharT* __s)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:828:31: note:   no known conversion for argument 1 from 'void' to 'const char*'
  828 |       operator=(const _CharT* __s)
      |                 ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  840 |       operator=(_CharT __c)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:840:24: note:   no known conversion for argument 1 from 'void' to 'char'
  840 |       operator=(_CharT __c)
      |                 ~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  858 |       operator=(basic_string&& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:32: note:   no known conversion for argument 1 from 'void' to 'std::__cxx11::basic_string<char>&&'
  858 |       operator=(basic_string&& __str)
      |                 ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:926:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  926 |       operator=(initializer_list<_CharT> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:926:42: note:   no known conversion for argument 1 from 'void' to 'std::initializer_list<char>'
  926 |       operator=(initializer_list<_CharT> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:18:29: error: no matching function for call to 'std::__cxx11::basic_string<char>::begin(int)'
   18 |   string s2 =reverse(s.begin(0),s.end((n-1)/2-1));
      |                      ~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:960:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::begin() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator]'
  960 |       begin() _GLIBCXX_NOEXCEPT
      |       ^~~~~
/usr/include/c++/14/bits/basic_string.h:960:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:969:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::begin() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
  969 |       begin() const _GLIBCXX_NOEXCEPT
      |       ^~~~~
/usr/include/c++/14/bits/basic_string.h:969:7: note:   candidate expects 0 arguments, 1 provided
a.cc:18:38: error: no matching function for call to 'std::__cxx11::basic_string<char>::end(int)'
   18 |   string s2 =reverse(s.begin(0),s.end((n-1)/2-1));
      |                                 ~~~~~^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:978:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::end() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator]'
  978 |       end() _GLIBCXX_NOEXCEPT
      |       ^~~
/usr/include/c++/14/bits/basic_string.h:978:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:987:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::end() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
  987 |       end() const _GLIBCXX_NOEXCEPT
      |       ^~~
/usr/include/c++/14/bits/basic_string.h:987:7: note:   candidate expects 0 arguments, 1 provided
a.cc:19:28: error: no matching function for call to 'std::__cxx11::basic_string<char>::begin(int)'
   19 |   string s3=reverse(s.begin((n+3)/2-1),s.end(n-1));
      |                     ~~~~~~~^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:960:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::begin() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator]'
  960 |       begin() _GLIBCXX_NOEXCEPT
      |       ^~~~~
/usr/include/c++/14/bits/basic_string.h:960:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:969:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::begin() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
  969 |       begin() const _GLIBCXX_NOEXCEPT
      |       ^~~~~
/usr/include/c++/14/bits/basic_string.h:969:7: note:   candidate expects 0 arguments, 1 provided
a.cc:19:45: error: no matching function for call to 'std::__cxx11::basic_string<char>::end(int)'
   19 |   string s3=reverse(s.begin((n+3)/2-1),s.end(n-1));
      |                                        ~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:978:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::end() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator]'
  978 |       end() _GLIBCXX_NOEXCEPT
      |       ^~~
/usr/include/c++/14/bits/basic_string.h:978:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:987:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::end() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_iterator = std::__cx