Language: C++

#include<iostream>
#include<string>
bool palin(const 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:18: error: 'string' does not name a type; did you mean 'stdin'?
    3 | bool palin(const string& S)
      |                  ^~~~~~
      |                  stdin
a.cc: In function 'bool palin(const int&)':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string K;
      |   ^~~~~~
a.cc:5: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:6:9: error: 'strlen' was not declared in this scope
    6 |   int L=strlen(S);
      |         ^~~~~~
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:8:6: error: invalid types 'const int[int]' for array subscript
    8 |     S[j]=K[i];
      |      ^
a.cc:8:10: error: 'K' was not declared in this scope
    8 |     S[j]=K[i];
      |          ^
a.cc:10:15: error: 'K' was not declared in this scope
   10 |   if(strcmp(S,K))
      |               ^
a.cc:10:6: error: 'strcmp' was not declared in this scope
   10 |   if(strcmp(S,K))
      |      ^~~~~~
a.cc:10:6: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
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: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:29:21: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
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
      |                  ^~~~
a.cc: In function 'bool palin(const int&)':
a.cc:14:1: warning: control reaches end of non-void function [-Wreturn-type]
   14 | }
      | ^