Language: C++

#include<iostream>
#include<string>
bool palin(string &S)
{
  string K;
  int L=strlen(S);
  for(int i=0,j=L-1;i<L&&j>=0;i++,j--){
    S[j]=K[i];
  }
  if(strcmp(S,K))
    return true;
  else
    return false;
}
int main()
{
  string S;
  bool pali;
  cin>>S;
  
  pali=palin(S);
  
  if(pali)
    pali=palin(S[0:(strlen(S)-2)/2]);
  else
    cout<<"No";
  
  if(pali)
    pali = palin(S[(strlen(S)+3)/2-1:strlen(S)-1]);
  else
    cout<<"No";
  if(pali)
    cout<<"Yes";
  else
    cout<<"No";
  
  return 0;
}


Compiler output:
a.cc:3:12: error: 'string' was not declared in this scope
    3 | bool palin(string &S)
      |            ^~~~~~
a.cc:3:12: 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:3:20: error: 'S' was not declared in this scope
    3 | bool palin(string &S)
      |                    ^
a.cc: In function 'int main()':
a.cc:17:3: error: 'string' was not declared in this scope
   17 |   string S;
      |   ^~~~~~
a.cc:17:3: note: suggested alternatives:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:19:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   19 |   cin>>S;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:19:8: error: 'S' was not declared in this scope
   19 |   cin>>S;
      |        ^
a.cc:21:13: error: 'palin' cannot be used as a function
   21 |   pali=palin(S);
      |        ~~~~~^~~
a.cc:24:19: error: expected ']' before ':' token
   24 |     pali=palin(S[0:(strlen(S)-2)/2]);
      |                   ^
      |                   ]
a.cc:26:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |     cout<<"No";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:29:21: error: 'strlen' was not declared in this scope
   29 |     pali = palin(S[(strlen(S)+3)/2-1:strlen(S)-1]);
      |                     ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
a.cc:29:37: error: expected ']' before ':' token
   29 |     pali = palin(S[(strlen(S)+3)/2-1:strlen(S)-1]);
      |                                     ^
      |                                     ]
a.cc:31:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   31 |     cout<<"No";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:33:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   33 |     cout<<"Yes";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:35:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   35 |     cout<<"No";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~