criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <stdio.h>
#include <string.h>

int main()
{
  char text[100],text2[50],text3[50];
  scanf("%s",text);
  
  int len = strlen(text);
  
  for (int i=0; i < (len-1)/2; i++)
    strcat(text2,text[i]);
  for (int i=(len+3)/2-1; i < len; i++)
    strcat(text3,text[i]);
  
  int text2_check = strlen(text2),text3_check = strlen(text3);
  for (int i=0; i <= (strlen(text2)+1)/2; i++)
  {
    if (text2[i] != text2[text2_len-1])
      break;
    text2_check -= 1;
  }
  
  
   

Compiler output:
main.c: In function 'main':
main.c:12:22: error: passing argument 2 of 'strcat' makes pointer from integer without a cast [-Wint-conversion]
   12 |     strcat(text2,text[i]);
      |                  ~~~~^~~
      |                      |
      |                      char
In file included from main.c:2:
/usr/include/string.h:149:70: note: expected 'const char * restrict' but argument is of type 'char'
  149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
main.c:14:22: error: passing argument 2 of 'strcat' makes pointer from integer without a cast [-Wint-conversion]
   14 |     strcat(text3,text[i]);
      |                  ~~~~^~~
      |                      |
      |                      char
/usr/include/string.h:149:70: note: expected 'const char * restrict' but argument is of type 'char'
  149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
main.c:19:27: error: 'text2_len' undeclared (first use in this function); did you mean 'text2_check'?
   19 |     if (text2[i] != text2[text2_len-1])
      |                           ^~~~~~~~~
      |                           text2_check
main.c:19:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:3: error: expected declaration or statement at end of input
   22 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int S;
    cin >> S;
    int n = S.size();
    vector<char> S(N);

    for (int i = 0; i < N; i++){
        if(S.at(i) != S.at.(N - i - 1)){
        cout << 'No' << endl;
        }
        else cout << 'Yes' << endl;
    }
}


Compiler output:
a.cc:12:17: warning: multi-character character constant [-Wmultichar]
   12 |         cout << 'No' << endl;
      |                 ^~~~
a.cc:14:22: warning: multi-character character constant [-Wmultichar]
   14 |         else cout << 'Yes' << endl;
      |                      ^~~~~
a.cc: In function 'int main()':
a.cc:7:15: error: request for member 'size' in 'S', which is of non-class type 'int'
    7 |     int n = S.size();
      |               ^~~~
a.cc:8:18: error: conflicting declaration 'std::vector<char> S'
    8 |     vector<char> S(N);
      |                  ^
a.cc:5:9: note: previous declaration as 'int S'
    5 |     int S;
      |         ^
a.cc:8:20: error: 'N' was not declared in this scope
    8 |     vector<char> S(N);
      |                    ^
a.cc:11:14: error: request for member 'at' in 'S', which is of non-class type 'int'
   11 |         if(S.at(i) != S.at.(N - i - 1)){
      |              ^~
a.cc:11:25: error: request for member 'at' in 'S', which is of non-class type 'int'
   11 |         if(S.at(i) != S.at.(N - i - 1)){
      |                         ^~
a.cc:11:28: error: expected unqualified-id before '(' token
   11 |         if(S.at(i) != S.at.(N - i - 1)){
      |                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

bool helper(string s, int i, int j) {
  while(i++ != j--) {
    if(s[i] != s[j]) 
      return false;
  }
  return true;
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  
  string s;
  cin>>s;
  int n = s.size();
  if(helper(s, 0, n-1) == false) {
    cout<<"No";
    continue;
  }
  else {
    if(helper(s, 0, ((n-1)/2) -1) && helper(s, ((n+3)/2) -1, n-1))
      	cout<<"Yes";
    else
      cout<<"No";
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: continue statement not within a loop
   21 |     continue;
      |     ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

bool helper(string s, int i, int j) {
  while(i++ != j--) {
    if(s[i] != s[j]) 
      return false;
  }
  return true;
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  
  string s;
  cin>>s;
  int n = s.size();
  if(helper(s, 0, ,n-1) == false) {
    cout<<"No";
    return 0;
  }
  else {
    if(helper(s, 0, (n-1)/2 -1) && helper(s, (n+3)/2 -1, n-1))
      	cout<<"Yes";
    else
      cout<<"No";
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: expected primary-expression before ',' token
   19 |   if(helper(s, 0, ,n-1) == false) {
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define f(k,n) for(auto i =k; i<n; i++)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie();
#define test ll t; cin>>t;
 
bool palindrone(string s){
    string t(s.rbegin(),s.rend());
    return s==t;
}
int main(){
    string s ; 
    cin>>s; 
    ll n  = s.length();
    string s1 = s.substr(0,(n-1)/2);
    string s2 = s.substr((n+1)/2);
    if((palindrone(s))&&(palindrone(s1))&&(palindrone(s2))) cout<<"yes"<<endl;
    else{
        cout<<"no"<<endl;
    }
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define f(k,n) for(auto i =k; i<n; i++)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie();
#define test ll t; cin>>t;

bool palindrone(string s){
    string t(s.rbegin(),s.rend());
    return s==t;
}
int main(){
    string s ; 
    cin>>s; 
    ll n  = s.length();
    string s1 = s.substr(0,(n-1)/2);
    string s2 = s.substr((n+1)/2);
    if((palindrone(s))&&(palindrone(s1))&&(palindrone(s2))) cout<<"Yes"<<endl;
    else{
        cout<<"No"<<endl;
    }
    return 0;
}


Compiler output:
a.cc:31:6: error: redefinition of 'bool palindrone(std::string)'
   31 | bool palindrone(string s){
      |      ^~~~~~~~~~
a.cc:8:6: note: 'bool palindrone(std::string)' previously defined here
    8 | bool palindrone(string s){
      |      ^~~~~~~~~~
a.cc:35:5: error: redefinition of 'int main()'
   35 | int main(){
      |     ^~~~
a.cc:12:5: note: 'int main()' previously defined here
   12 | int main(){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  string s;
  int len = s.length();
  int k = len / 2 + 1;
  int i = 0, j = len / 2 - 1, l = len - 1;
  while(i < j){
  	if( a[k]!=a[i] || a[k]!=a[j] || a[k]!=a[l])
      return cout << "No", 0;
    i++, j--, k++, l--;
  }
  cout << "Yes";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'a' was not declared in this scope
   11 |         if( a[k]!=a[i] || a[k]!=a[j] || a[k]!=a[l])
      |             ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;

int main() {
  string s;
  bool cond = true;
  cin >> s;
  rep(i,s.size() / 2){
    if (s[i] != s[s.size() - 1 - i) {
      cond = false;
    }
  }
  rep(i, s.size() / 2){
    if (s[i] != s[s.size() / 2 - 1 - i]){
      cond = false;
    }
  }
  rep(i, s.size() / 2){
    if (s[i + s.size() / 2 + 1] != s[s.size() - 1 - i]){
      cond = false;
    }
  }
  cout << (cond? "Yes":"No")<< endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:35: error: expected ']' before ')' token
   11 |     if (s[i] != s[s.size() - 1 - i) {
      |                                   ^
      |                                   ]
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string S;
  int N;
  if(  for(int i=0;i<N;i++){
    S.at(i)=S.at(N-i+1)}){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: expected primary-expression before 'for'
    6 |   if(  for(int i=0;i<N;i++){
      |        ^~~
a.cc:6:6: error: expected ')' before 'for'
    6 |   if(  for(int i=0;i<N;i++){
      |     ~^ ~~~
      |      )
a.cc:6:20: error: 'i' was not declared in this scope
    6 |   if(  for(int i=0;i<N;i++){
      |                    ^
a.cc:7:25: error: expected primary-expression before ')' token
    7 |     S.at(i)=S.at(N-i+1)}){
      |                         ^
a.cc:10:3: error: 'else' without a previous 'if'
   10 |   else{
      |   ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

bool check(strind s) {
  string t = s;
  reverse(t.begin(), t.end());
  if (s == t) return true;
  else return false;
}

int main() {
  string s;
  cin >> s;
  int n = (int)s.size();
  string s1 = "", s2 = "";
  for (int i=0; i<n; i++) {
    if (i < n / 2) s1 += s.at(i);
    else if (i > n / 2) s2 += s.at(i);
  }
  if (check(s) && check(s1) && check(s2)) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Compiler output:
a.cc:5:12: error: 'strind' was not declared in this scope; did you mean 'strtod'?
    5 | bool check(strind s) {
      |            ^~~~~~
      |            strtod
a.cc: In function 'int main()':
a.cc:21:12: error: 'check' cannot be used as a function
   21 |   if (check(s) && check(s1) && check(s2)) cout << "Yes" << endl;
      |       ~~~~~^~~
a.cc:21:24: error: 'check' cannot be used as a function
   21 |   if (check(s) && check(s1) && check(s2)) cout << "Yes" << endl;
      |                   ~~~~~^~~~
a.cc:21:37: error: 'check' cannot be used as a function
   21 |   if (check(s) && check(s1) && check(s2)) cout << "Yes" << endl;
      |                                ~~~~~^~~~
Language: C++

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

int main() {
	string S;
	cin >> S;

	int N = S.size();

	string Re_S = S;

	string S2 = S.substr(0,(N-1)/2);
	string Re_S2 = S2;

	string S3 = S.substr(((N+3)/2)-1,N+1- ((N + 3) / 2));
	string Re_S3 = S3;


	reverse(Re_S.begin(), Re_S.end());
	reverse(Re_S2.begin(), Re_S2.end());
	reverse(Re_S3.begin(), Re_S3.end());

	if (S == Re_S && S2 == Re_S2 && S3 == Re_S3) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'reverse' was not declared in this scope
   20 |         reverse(Re_S.begin(), Re_S.end());
      |         ^~~~~~~
Language: C++

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

int main() {
	string S;
	cin >> S;

	int N = S.size();

	string Re_S = S;

	string S2 = S.substr(0,(N-1)/2);
	string Re_S2 = S2;

	string S3 = S.substr(((N+3)/2)-1,N+1- ((N + 3) / 2));
	string Re_S3 = S3;


	reverse(Re_S.begin(), Re_S.end());
	reverse(Re_S2.begin(), Re_S2.end());
	reverse(Re_S3.begin(), Re_S3.end());

	if (S == Re_S && S2 == Re_S2 && S3 == Re_S3) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	cout << Re_S3;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'reverse' was not declared in this scope
   20 |         reverse(Re_S.begin(), Re_S.end());
      |         ^~~~~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class problemB {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String input = reader.readLine();
        int length = input.length();
        int latter = (length + 3) / 2  - 1;
        int i = 0;
        for (i = 0; i < length / 2; i++) {
            if (input.charAt(i) != input.charAt(input.length() - 1 - i)) {
                break;

            }
            if (i < (length) / 2) {
                if (input.charAt(i) != input.charAt((length) / 2 -1- i)) {

                    break;
                }
            }
            if (i < (length - latter) / 2) {
                if (input.charAt(length - i - 1) != input.charAt(latter + i)) {
                    break;
                }
            }
        }
        if (i == length / 2) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

Compiler output:
Main.java:5: error: class problemB is public, should be declared in a file named problemB.java
public class problemB {
       ^
1 error
Language: C

#include<stdio.h>
#include<string,h>
int main()
{
char str[100];
scanf("%s",str);
int i,j,n,flag=0,k,s;
  n=strlen(str);
  for(i=n;i>=1;i--)
  {
    str[i]=str[i-1];
  }
  for(i=1;i<=n/2;i++)
  {
    if(str[i]!=str[n+1-i]
       {
         flag=2;
         break;
       }
  }
       j=(n-1)/4;
       k=(n-1)/2;
       for(i=1;i<=j;i++)
       {
         if(str[i]!=str[k+1-i]
            {
              flag=2;
              break;
            }
         }
            k=(n+3)/2;
            j=(1+(n-3)/2)/2;
            s=0;
            for(i=k;i<n;i++)
            {
              s++;
              if(str[i]!=str[n+1-s];
                 {
                   flag=2;
                   break;
                 }
              }
                 if(flag==0)
                 printf("YES");
                 else
                 printf("NO");
}

Compiler output:
main.c:2:9: fatal error: string,h: No such file or directory
    2 | #include<string,h>
      |         ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    String S = scanner.next();
    
    int N = S.length();
    String S1 = S.substring(0,(N - 1) / 2);
    String S2 = S.substring((N + 3) / 2 - 1,N);
    
    String answer = "No";
    if(k(S,N) && k(S1,S1.length()) && k(S2,S2.length())){
      answer = "Yes";
    }
    
    System.out.println(answer);
  }
  
  public static boolean k(String str,int length){
    for(int i = 0;i < (length + 1) / 2;i++){
         /*System.out.println(
          i + "," + 
          str.charAt(i) + "," + str.charAt(length - i - 1));
      if(str.charAt(i) != str.charAt(length - i - 1)){
*/
        return false;
      }
    }
    return true;
  }
}

Compiler output:
Main.java:30: error: illegal start of type
    return true;
    ^
Main.java:32: error: class, interface, enum, or record expected
}
^
2 errors
Language: C++

#include<iostream>
#include<string>
using namespace std;
int hantei(char a[],int start,int end)
{
	int i;
	int count;
	for(i=0;i<end-start+1;i++)
	{
		if(a[start+i-1] != a[end-i-1]) {count = 0; break;}
		if(i == end-start){count = 1;}
	}
	return count;
}
int main()
{
	char a[100];
	cin >> a;
	int count;
	int N = strlen(a);
    count = hantei(a,1,N) +
    hantei(a,1,(N-1)/2)+
    hantei(a,(N+3)/2,N);
	if(count == 3) cout << "Yes";
	else cout << "No";
	return 0;
}
		

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'strlen' was not declared in this scope
   20 |         int N = strlen(a);
      |                 ^~~~~~
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>
Language: C++

#include<iostream>
#include<string>
using namespace std;
int hantei(char a[],int start,int end)
{
	int i;
	int count;
	for(i=0;i<end-start+1;i++)
	{
		if(a[start+i-1] != a[end-i-1]) {count = 0; break;}
		if(i == end-start){count = 1;}
	}
	return count;
}
int main()
{
	char a[100];
	cin >> a;
	int count;
    count = hantei(a,1,strlen(a)) +
    hantei(a,1,(strlen(a)-1)/2)+
    hantei(a,(strlen(a)+3)/2,strlen(a));
	if(count == 3) cout << "Yes";
	else cout << "No";
	return 0;
}
		

Compiler output:
a.cc: In function 'int main()':
a.cc:20:24: error: 'strlen' was not declared in this scope
   20 |     count = hantei(a,1,strlen(a)) +
      |                        ^~~~~~
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>
Language: C++

// 2020 03/24 B - String Palindrome 回文

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

bool isPalindrome(string s) {
    string t = s;
    reverse(t.begin(), t.end());
    return s == t;
}

int main(){
    string s;
    cin >> s;
    bool ans = true;
    if (!isPalindrome(s)) ans = false;
    if (!isPalindrome(s.substr(0, s.size()/2))) ans = false;
    // substr 部分文字列を取得
    // 切り捨て

    cout << (ans ? "Yes" : "No") << endl;

    return 0;
}

Compiler output:
a.cc: In function 'bool isPalindrome(std::string)':
a.cc:9:5: error: 'reverse' was not declared in this scope
    9 |     reverse(t.begin(), t.end());
      |     ^~~~~~~
Language: C++

#include<iostream>
#include<string>
using namepsace std;
int main()
{
  int state=0;
  string t;
  cin>>t;
  int n=t.size();
  for (int i=0;i<(n-1)/4;i++)
  {
     if (t[i]!=t[(n-1)/4 -i-1])
     {
       state=1;
       break;
     }
  }
  if (state==0)
  {
    for (int i=0;i<(n-1)/2;i++)
  {
     if (t[i]!=t[(n-1)/2 -i-1])
     {
       state=1;
       break;
     }
  }
  }
  if(state)
  {
   cout<<"No"endl; 
  }
  else
  {
    cout<<"Yes"<<endl;
}


Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namepsace'
    3 | using namepsace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string t;
      |   ^~~~~~
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:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin>>t;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:8: error: 't' was not declared in this scope; did you mean 'tm'?
    8 |   cin>>t;
      |        ^
      |        tm
a.cc:31:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   31 |    cout<<"No"endl;
      |    ^~~~
      |    std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:31:10: error: unable to find string literal operator 'operator""endl' with 'const char [3]', 'long unsigned int' arguments
   31 |    cout<<"No"endl;
      |          ^~~~~~~~
a.cc:35:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   35 |     cout<<"Yes"<<endl;
      |     ^~~~
      |     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:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   35 |     cout<<"Yes"<<endl;
      |                  ^~~~
      |                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<iostream>
#include<string>
using namepsace std;
int main()
{
  int state=0;
  string t;
  cin>>t;
  int n=t.size();
  for (int i=0;i<(n-1)/4;i++)
  {
     if (t[i]!=t[(n-1)/4 -i-1])
     {
       state=1;
       break;
     }
  }
  if (state==0)
  {
    for (int i=0;i<(n-1)/2;i++)
  {
     if (t[i]!=t[(n-1)/2 -i-1])
     {
       state=1;
       break;
     }
  }
  }
  if(state)
  {
   cout<<"No"endl; 
  }
  else
  {
    cout<<"Yes<endl;
}


Compiler output:
a.cc:35:11: warning: missing terminating " character
   35 |     cout<<"Yes<endl;
      |           ^
a.cc:35:11: error: missing terminating " character
   35 |     cout<<"Yes<endl;
      |           ^~~~~~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'namepsace'
    3 | using namepsace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string t;
      |   ^~~~~~
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:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin>>t;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:8: error: 't' was not declared in this scope; did you mean 'tm'?
    8 |   cin>>t;
      |        ^
      |        tm
a.cc:31:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   31 |    cout<<"No"endl;
      |    ^~~~
      |    std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:31:10: error: unable to find string literal operator 'operator""endl' with 'const char [3]', 'long unsigned int' arguments
   31 |    cout<<"No"endl;
      |          ^~~~~~~~
a.cc:35:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   35 |     cout<<"Yes<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:36:1: error: expected primary-expression before '}' token
   36 | }
      | ^
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
        String b = "Yes";
        int c = a.length();
        for(int i=0;i<(c-1)/2;i++){if(a.charAt(i).equals(a.charAt(c-1-i)) && a.charAt(i).equals(a.charAt((c-1)/2-1-i))){ }
                                  else{b = "No";break;}
                                  }
		System.out.println(b);
	}
}


Compiler output:
Main.java:8: error: char cannot be dereferenced
        for(int i=0;i<(c-1)/2;i++){if(a.charAt(i).equals(a.charAt(c-1-i)) && a.charAt(i).equals(a.charAt((c-1)/2-1-i))){ }
                                                 ^
Main.java:8: error: char cannot be dereferenced
        for(int i=0;i<(c-1)/2;i++){if(a.charAt(i).equals(a.charAt(c-1-i)) && a.charAt(i).equals(a.charAt((c-1)/2-1-i))){ }
                                                                                        ^
2 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
        String b = "Yes";
        int c = a.length();
        for(int i=0;i<(c-1)/2;i++){if(a.charAt(i).equals(a.charAt(c-1-i)) && a.charAt(i).equals(a.charAt((c-1)/2-1-i))){}
                                  else{b = "No";break;}
                                  }
		System.out.println(b);
	}
}


Compiler output:
Main.java:8: error: char cannot be dereferenced
        for(int i=0;i<(c-1)/2;i++){if(a.charAt(i).equals(a.charAt(c-1-i)) && a.charAt(i).equals(a.charAt((c-1)/2-1-i))){}
                                                 ^
Main.java:8: error: char cannot be dereferenced
        for(int i=0;i<(c-1)/2;i++){if(a.charAt(i).equals(a.charAt(c-1-i)) && a.charAt(i).equals(a.charAt((c-1)/2-1-i))){}
                                                                                        ^
2 errors
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a; i< (int)(b); ++i)
using ll=long long;
using namespace std;
const auto mod=1e9+7;

bool ispalindrome(string s){
  string t(s.rbegin(),s.rend());
  return s==t;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  
  string s,ans="No";cin >> s;
  int n=s.size();
  if(isPalindrome(s) and isPalindrome(s.substr(0,(n+1)/2)) and isPalindrome(s.substr((n+1)/2))){
    ans="Yes";
  }
  
  cout << ans << endl;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:19:6: error: 'isPalindrome' was not declared in this scope; did you mean 'ispalindrome'?
   19 |   if(isPalindrome(s) and isPalindrome(s.substr(0,(n+1)/2)) and isPalindrome(s.substr((n+1)/2))){
      |      ^~~~~~~~~~~~
      |      ispalindrome
Language: Java

import java.util.*;
public class Main {
    /* 
    public static boolean isPalindrome(String str, int start, int end){
      if( end - start <= 1){
        return true;
      }
      else{
        if(str.indexOf(start) == str.indexOf(end)){
        	return isPalindrome(str,start+1,end-1);
        }
        else{
        	return false;
        }
      }
    }
    */
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
      	int len = str.length();
 		String leftfStr = str.substring(0,(len-1)/2);
      	String rightStr = str.substring((len+1)/2,len);
      	boolean isStrongPalindrome = new StringBuffer(leftStr).reverse().toString().equals(leftStr)
          && new StringBuffer(rightStr).reverse().toString().equals(rightStr)
          && new StringBuffer(str).reverse().toString().equals(str);
          
		System.out.println(isStrongPalindrome?"Yes":"No");
	}
}

Compiler output:
Main.java:24: error: cannot find symbol
      	boolean isStrongPalindrome = new StringBuffer(leftStr).reverse().toString().equals(leftStr)
      	                                                                                   ^
  symbol:   variable leftStr
  location: class Main
Main.java:24: error: cannot find symbol
      	boolean isStrongPalindrome = new StringBuffer(leftStr).reverse().toString().equals(leftStr)
      	                                              ^
  symbol:   variable leftStr
  location: class Main
2 errors
Language: Java

import java.util.*;
public class Main {
    /* 
    public static boolean isPalindrome(String str, int start, int end){
      if( end - start <= 1){
        return true;
      }
      else{
        if(str.indexOf(start) == str.indexOf(end)){
        	return isPalindrome(str,start+1,end-1);
        }
        else{
        	return false;
        }
      }
    }
    */
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
 		String halfStr = str.substring(0,str.length()+1)/2);
		// boolean isStrongPalindrome = isPalindrome(str,0,(str.length()+1)/2)
      	boolean isStrongPalindrome = new StringBuffer(halfStr).reverse().toString().equals(halfStr)
          && new StringBuffer(str).reverse().toString().equals(str);
          
		System.out.println(isStrongPalindrome?"Yes":"No");
	}
}

Compiler output:
Main.java:21: error: ';' expected
 		String halfStr = str.substring(0,str.length()+1)/2);
 		                                                  ^
1 error
Language: Java

import java.util.*;
public class Main {
    /* 
    public static boolean isPalindrome(String str, int start, int end){
      if( end - start <= 1){
        return true;
      }
      else{
        if(str.indexOf(start) == str.indexOf(end)){
        	return isPalindrome(str,start+1,end-1);
        }
        else{
        	return false;
        }
      }
    }
    */
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
 		String halfStr = str.substring(0,(str.length()+1)/2);
		// boolean isStrongPalindrome = isPalindrome(str,0,(str.length()+1)/2)
      	boolean isStrongPalindrome = new StringBuffer(halfstr).reverse().toString().equals(halfStr)
          && new StringBuffer(str).reverse().toString().equals(str);
          
		System.out.println(isStrongPalindrome?"Yes":"No");
	}
}

Compiler output:
Main.java:23: error: cannot find symbol
      	boolean isStrongPalindrome = new StringBuffer(halfstr).reverse().toString().equals(halfStr)
      	                                              ^
  symbol:   variable halfstr
  location: class Main
1 error
Language: Java

import java.util.*;
public class Main {
    /* 
    public static boolean isPalindrome(String str, int start, int end){
      if( end - start <= 1){
        return true;
      }
      else{
        if(str.indexOf(start) == str.indexOf(end)){
        	return isPalindrome(str,start+1,end-1);
        }
        else{
        	return false;
        }
      }
    }
    */
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
 		String halfStr = str.substring(0,str.length()+1)/2);
		// boolean isStrongPalindrome = isPalindrome(str,0,(str.length()+1)/2)
      	boolean isStrongPalindrome = new StringBuffer(halfstr).reverse().toString().equals(halfStr)
          && new StringBuffer(str).reverse().toString().equals(str);
          
		System.out.println(isStrongPalindrome?"Yes":"No");
	}
}

Compiler output:
Main.java:21: error: ';' expected
 		String halfStr = str.substring(0,str.length()+1)/2);
 		                                                  ^
1 error
Language: C++

#include <iostream>
#include <cstdio>
#include <iterator>
#include <algorithm>
#include <map>
#include <cstring>
using namespace std;

int is_palindrome(string s){
  return equal(s.begin(), s.begin() + s.length() / 2, s.rbegin());
}

int main(){
  char s[200] = {0};
  gets(s);

  if(is_palindrome(s)){
    printf("YES\n");
  }else{
    printf("NO\n");
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
   15 |   gets(s);
      |   ^~~~
      |   getw
Language: C++

#include<bits/stdc++.h>
using namespace std;

bool check(string s)
 {
     string s1=s;
     reverse(s1.begin(),s1.end());
     if(s1==s)
     return true;
     else
     return false;
 }
int main() {
    string s;
    cin>>s;
    ll n=s.length();
   string s1="";string s2="";
    FOR(i,0,((n-1)/2))
    s1+=s[i];
     FOR(i,((n+3)/2)-1,n)
    s2+=s[i];
    //cout<<s<<" "<<s1<<" "<<s2;
    if(check(s) and check(s1) and check(s2) )
    cout<<"Yes";
    else
    cout<<"No";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'll' was not declared in this scope
   16 |     ll n=s.length();
      |     ^~
a.cc:18:9: error: 'i' was not declared in this scope
   18 |     FOR(i,0,((n-1)/2))
      |         ^
a.cc:18:15: error: 'n' was not declared in this scope
   18 |     FOR(i,0,((n-1)/2))
      |               ^
a.cc:18:5: error: 'FOR' was not declared in this scope
   18 |     FOR(i,0,((n-1)/2))
      |     ^~~
Language: C++

bool check(string s)
 {
     string s1=s;
     reverse(s1.begin(),s1.end());
     if(s1==s)
     return true;
     else
     return false;
 }
int main() {
    string s;
    cin>>s;
    ll n=s.length();
   string s1="";string s2="";
    FOR(i,0,((n-1)/2))
    s1+=s[i];
     FOR(i,((n+3)/2)-1,n)
    s2+=s[i];
    //cout<<s<<" "<<s1<<" "<<s2;
    if(check(s) and check(s1) and check(s2) )
    cout<<"Yes";
    else
    cout<<"No";
    
}

Compiler output:
a.cc:1:12: error: 'string' was not declared in this scope
    1 | bool check(string s)
      |            ^~~~~~
a.cc: In function 'int main()':
a.cc:11:5: error: 'string' was not declared in this scope
   11 |     string s;
      |     ^~~~~~
a.cc:12:5: error: 'cin' was not declared in this scope
   12 |     cin>>s;
      |     ^~~
a.cc:12:10: error: 's' was not declared in this scope
   12 |     cin>>s;
      |          ^
a.cc:13:5: error: 'll' was not declared in this scope
   13 |     ll n=s.length();
      |     ^~
a.cc:14:10: error: expected ';' before 's1'
   14 |    string s1="";string s2="";
      |          ^~~
      |          ;
a.cc:14:23: error: expected ';' before 's2'
   14 |    string s1="";string s2="";
      |                       ^~~
      |                       ;
a.cc:15:9: error: 'i' was not declared in this scope
   15 |     FOR(i,0,((n-1)/2))
      |         ^
a.cc:15:15: error: 'n' was not declared in this scope
   15 |     FOR(i,0,((n-1)/2))
      |               ^
a.cc:15:5: error: 'FOR' was not declared in this scope
   15 |     FOR(i,0,((n-1)/2))
      |     ^~~
a.cc:20:13: error: 'check' cannot be used as a function
   20 |     if(check(s) and check(s1) and check(s2) )
      |        ~~~~~^~~
a.cc:20:27: error: 's1' was not declared in this scope
   20 |     if(check(s) and check(s1) and check(s2) )
      |                           ^~
a.cc:20:29: error: 'check' cannot be used as a function
   20 |     if(check(s) and check(s1) and check(s2) )
      |                             ^
a.cc:20:41: error: 's2' was not declared in this scope
   20 |     if(check(s) and check(s1) and check(s2) )
      |                                         ^~
a.cc:20:43: error: 'check' cannot be used as a function
   20 |     if(check(s) and check(s1) and check(s2) )
      |                                           ^
a.cc:21:5: error: 'cout' was not declared in this scope
   21 |     cout<<"Yes";
      |     ^~~~
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout<<"No";
      |     ^~~~
Language: Java

import java.util.*;
public class Main {
    public static boolean isPalindrome(String str){
      if(str.length() <= 1){
        return true;
      }
      else{
        if(str[0] == str[str.length()-1]){
        	return isPalindrome(str.subString(1,str.length()-1));
        }
        else{
        	return false;
        }
      }
    }
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String str = sc.nextline();
 
		boolean isStrongPalindrome = isPalindrome(str.subString(0,(str.length()+1)/2))
          && isPalindrome(str);
          
		System.out.println(isStrongPalindrome?"Yes":"No");
	}
}

Compiler output:
Main.java:8: error: array required, but String found
        if(str[0] == str[str.length()-1]){
              ^
Main.java:8: error: array required, but String found
        if(str[0] == str[str.length()-1]){
                        ^
Main.java:9: error: cannot find symbol
        	return isPalindrome(str.subString(1,str.length()-1));
        	                       ^
  symbol:   method subString(int,int)
  location: variable str of type String
Main.java:18: error: cannot find symbol
		String str = sc.nextline();
		               ^
  symbol:   method nextline()
  location: variable sc of type Scanner
Main.java:20: error: cannot find symbol
		boolean isStrongPalindrome = isPalindrome(str.subString(0,(str.length()+1)/2))
		                                             ^
  symbol:   method subString(int,int)
  location: variable str of type String
5 errors
Language: Java

import java.util.*;
public class Main {
    public static boolean isPalindrome(String str){
      if(str.length() <= 1){
        return true;
      }
      else{
        if(str[0] == str[str.length()-1]){
        	return isPalindrome(str.subString(1,str.length()-1))
        }
        else{
        	return false;
        }
      }
    }
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String str = sc.nextline();

		boolean isStrongPalindrome = isPalindrome(str.subString(0,(str.length()+1)/2))
          && isPalindrome(str);
          
		System.out.println(isStrongPalindrome?"Yes":"No");
	}
}

Compiler output:
Main.java:9: error: ';' expected
        	return isPalindrome(str.subString(1,str.length()-1))
        	                                                    ^
1 error
Language: C++

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

int main() {
	int N, count=0, a, b;
	char S[100];
	cin >> S;
	N = strlen(S);
	a = (N - 1) / 2;
	b = (N + 3) / 2;
	for (int i = 0; i < N / 2 ; i++) {
		if (S[i + 1] == S[a]) {
			a++;
			if (S[b] == S[N - i]) {

			}
			else {
				count++;
			}
		}
		else {
			count++;
		}
	}

	if (count == 0)
		cout << "Yes";
	else
		cout << "No";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'strlen' was not declared in this scope
    9 |         N = 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>
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
using ll = long long;

int main() {
  string s;
  int n = string.size();
  bool ok = true;
  rep(i,n){
    if(s[i] != s[n - i] || s[i] != s[(n - 1)/2 - i]
    || s[(n + 3)/2 + i] != s[n]){
      ok = false;
      break;
    } 
  }
  
  if(ok) puts("Yes"); else puts("No");
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: expected primary-expression before '.' token
    8 |   int n = string.size();
      |                 ^
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;
string str;

bool isPalindrome(int begin, int end) {
    string s, s_cpy;
    for (int i = begin; i <= end; i++) {
        s += str[i];
    }
    s_cpy = s;
    reverse(s.begin(), s.end());
    if (s == s_cpy) {
        return true;
    } else {
        return false;
    }
}

int main() {
    cin >> str;
    int len = str.length();
    if (isPalindrome(0, len - 1) && isPalindrome(0, (len - 1) / 2 - 1) && isPalindrome((len + 3) / 2 - 1, len - 1)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: expected '}' at end of input
   29 |     return 0;
      |              ^
a.cc:21:12: note: to match this '{'
   21 | int main() {
      |            ^
Language: C++

#include <iostream>

using namespace std;
string str;

bool isPalindrome(int begin, int end) {
    string s, s_cpy;
    for (int i = begin; i <= end; i++) {
        s += str[i];
    }
    s_cpy = s;
    reverse(s.begin(), s.end());
    if (s == s_cpy) {
        return true;
    } else {
        return false;
    }
}

int main() {
    cin >> str;
    int len = str.length();
    if (isPalindrome(0, len - 1) && isPalindrome(0, (len - 1) / 2 - 1) && isPalindrome((len + 3) / 2 - 1, len - 1)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'bool isPalindrome(int, int)':
a.cc:12:5: error: 'reverse' was not declared in this scope
   12 |     reverse(s.begin(), s.end());
      |     ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 	string s;
  	cin >> s;
  	int n = s.size();
  	for(long long i = 0; i < n; i++) {
      	if(s[i] != s[n - i - 1] {
          	cout << "No" << endl;
          	return 0;
        }
    }
  	long long x = (n - 1) / 2;
  	for(long long i = 0; i < x; i++) {
      	if(s[i] != s[x - i - 1]) {
          	cout << "No" << endl;
          	return 0;
        }
    }
  	x = (n + 3) / 2;
  	for(long long i = x; i < n; i++) {
      	if(s[i] != s[n - i + x - 1]) {
          	cout << "No" << endl;
          	return 0;
        }
    }
 	cout << "Yes" << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: expected ')' before '{' token
    9 |         if(s[i] != s[n - i - 1] {
      |           ~                    ^~
      |                                )
a.cc:13:5: error: expected primary-expression before '}' token
   13 |     }
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
 	string s;
  	cin >> s;
  	int n = s.size();
  	string s1 = reverse(s.begin(), s.end());
  	if(s != s1) {
      	cout << "No" << endl;
        return 0;
    }
  	long long x = (n - 1) / 2;
  	for(long long i = 0; i < x; i++) {
      	if(s[i] != s[x - i]) {
          	cout << "No" << endl;
          	return 0;
        }
    }
  	x = (n + 3) / 2;
  	for(long long i = x; i < n; i++) {
      	if(s[i] != s[n - i + x]) {
          	cout << "No" << endl;
          	return 0;
        }
    }
 	cout << "Yes" << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: conversion from 'void' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    8 |         string s1 = reverse(s.begin(), s.end());
      |                     ~~~~~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

// 'r'  " 
int main(){
  string s,a,b,c,d;
  cin >> s;
  int n = s.size();
  n /= 2;
  a = b = s.substr(0,n);
  c = d = s.sunstr(n+1,n);
  reverse(b.begin(),b.end());
  reverse(d.begin(),d.end());
  bool ans = (a==b)&&(c==d)&&(a==d);
  if(ans){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sunstr'; did you mean 'substr'?
   13 |   c = d = s.sunstr(n+1,n);
      |             ^~~~~~
      |             substr
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

// 'r'  " 
int main(){
  string s,a,b,c,d;
  cin >> s;
  int n = s.size();
  n /= 2;
  a = b = s.substr(0,n);
  c = d = s.sunstr(n+1,n);
  reverse(b.begin(),b.end());
  reverse(d.begin(),d.end());
  bool ans = (a==b)&&(c==d);
  if(ans){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sunstr'; did you mean 'substr'?
   13 |   c = d = s.sunstr(n+1,n);
      |             ^~~~~~
      |             substr
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

// 'r'  " 
int main(){
  string >> s;
  int n = s.size();
  n /= 2;
  string a = s.substr(0,n);
  bool ans = a == string(a.rbegin(),a.rend());
  a = s.substr(n+1,n);
  ans = ans & (a== string(a.rbegin(),a.rend()));
  if(ans)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: expected unqualified-id before '>>' token
    8 |   string >> s;
      |          ^~
a.cc:9:11: error: 's' was not declared in this scope
    9 |   int n = s.size();
      |           ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
  string s;
  cin >> s;
  
  string t="";
  for(ll i=0;i<s.length()/2;i++)
    	t += s[i];
  
  string t1 = t;
  reverse(t1.begin(),t1.end());
  
  if(t!=t1)
  {
    cout << "No" << endl;
    return 0;
  }
  
  string t2="";
  for(ll i=s.length()/2 + 1;i<s.length();i++)
    t2 += s[i];
  
  string t3=t2;
  
  reverse(t3.begin(),t3.end());
  
  if(t3==t2)
    cout << "Yes" << endl;
  else	
    cout << "No" << endl;
  
  
  
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'll' was not declared in this scope
   11 |   for(ll i=0;i<s.length()/2;i++)
      |       ^~
a.cc:11:14: error: 'i' was not declared in this scope
   11 |   for(ll i=0;i<s.length()/2;i++)
      |              ^
a.cc:24:7: error: 'll' was not declared in this scope
   24 |   for(ll i=s.length()/2 + 1;i<s.length();i++)
      |       ^~
a.cc:24:29: error: 'i' was not declared in this scope
   24 |   for(ll i=s.length()/2 + 1;i<s.length();i++)
      |                             ^
Language: C++

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

bool pal(string& s){
	int l = 0, r = s.size()-1;
  while(l<r){
  	if (s[l]!=s[r]){return false;}
    l++;r--;
  }
  return true;
}

int main(){
  string s;cin>>s;
  int n = s.size();
	bool ans = pal(s) && pal(s.substr(0,(n-1)/2-1)) && pal(s.substr((n+3)/2-1, n-(n+3)/2+1));
  cout<<(ans?"Yes":"No")<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:42: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   17 |         bool ans = pal(s) && pal(s.substr(0,(n-1)/2-1)) && pal(s.substr((n+3)/2-1, n-(n+3)/2+1));
      |                                  ~~~~~~~~^~~~~~~~~~~~~
a.cc:5:18: note:   initializing argument 1 of 'bool pal(std::string&)'
    5 | bool pal(string& s){
      |          ~~~~~~~~^
a.cc:17:72: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   17 |         bool ans = pal(s) && pal(s.substr(0,(n-1)/2-1)) && pal(s.substr((n+3)/2-1, n-(n+3)/2+1));
      |                                                                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:5:18: note:   initializing argument 1 of 'bool pal(std::string&)'
    5 | bool pal(string& s){
      |          ~~~~~~~~^
Language: C++

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

bool pal(string& s){
	int l = 0, r = s.size()-1;
  while(l<r){
  	if (s[l]!=s[r]){return false;}
    l++;r--;
  }
  return true;
}

int main(){
  string s;cin>>s;
	bool ans = pal(s) && pal(s.substr(0,(n-1)/2-1)) && pal(s.substr((n+3)/2-1, n-(n+3)/2+1));
  cout<<(ans?"Yes":"No")<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:46: error: 'n' was not declared in this scope
   16 |         bool ans = pal(s) && pal(s.substr(0,(n-1)/2-1)) && pal(s.substr((n+3)/2-1, n-(n+3)/2+1));
      |                                              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int palindro(string s)
{int i=0;
 int u=s.size();
 int flag=1;
 while(i<u)
 {if(s[i]!=s[u])
 {flag=0;
  break;}}
 return flag;}
int main()
{string s,s1,s2;
 getline(cin,s);
 int u=s.size();
 s1=s.substr(0,(u/2));
 s2=s.substr(((u/2)+1),(u/2));
 if(((s1==s2)&&(palindro(s1))&&(palindro(s2))&&(palindro(s)))
    cout<<"Yes";
 else
    cout<<"No";}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:62: error: expected ';' before 'cout'
   18 |  if(((s1==s2)&&(palindro(s1))&&(palindro(s2))&&(palindro(s)))
      |                                                              ^
      |                                                              ;
   19 |     cout<<"Yes";
      |     ~~~~                                                      
a.cc:20:2: error: expected primary-expression before 'else'
   20 |  else
      |  ^~~~
a.cc:19:17: error: expected ')' before 'else'
   19 |     cout<<"Yes";
      |                 ^
      |                 )
   20 |  else
      |  ~~~~            
a.cc:18:4: note: to match this '('
   18 |  if(((s1==s2)&&(palindro(s1))&&(palindro(s2))&&(palindro(s)))
      |    ^