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

public class test {

 

    /**
     * @param args
     */
    public static void main(final String[] args) {



 		Scanner aStr = new Scanner(System.in);

        /** 不一致件数カウント */
        int aCount = 0;
        /** インクリメント変数 */
        int aI = 0;

 

        while (aI * 2 < aStr.length()) {

 

            if (aStr.charAt(aI) == aStr.charAt(aStr.length() - aI - 1)) {
                // 何もしない
            } else {
                aCount++;
            }

 

            aI++;
        }

 

        System.out.println(aCount);
    }
}

Compiler output:
Main.java:1: error: class test is public, should be declared in a file named test.java
public class test {
       ^
Main.java:12: error: cannot find symbol
 		Scanner aStr = new Scanner(System.in);
 		^
  symbol:   class Scanner
  location: class test
Main.java:12: error: cannot find symbol
 		Scanner aStr = new Scanner(System.in);
 		                   ^
  symbol:   class Scanner
  location: class test
3 errors
Language: Java

import java.util.*;
public class test {

 

    /**
     * @param args
     */
    public static void main(final String[] args) {

 

        final String aStr = args[0];

 

        /** 不一致件数カウント */
        int aCount = 0;
        /** インクリメント変数 */
        int aI = 0;

 

        while (aI * 2 < aStr.length()) {

 

            if (aStr.charAt(aI) == aStr.charAt(aStr.length() - aI - 1)) {
                // 何もしない
            } else {
                aCount++;
            }

 

            aI++;
        }

 

        System.out.println(aCount);
    }
}

Compiler output:
Main.java:2: error: class test is public, should be declared in a file named test.java
public class test {
       ^
1 error
Language: Java

public class test {

 

    /**
     * @param args
     */
    public static void main(final String[] args) {

 

        final String aStr = args[0];

 

        /** 不一致件数カウント */
        int aCount = 0;
        /** インクリメント変数 */
        int aI = 0;

 

        while (aI * 2 < aStr.length()) {

 

            if (aStr.charAt(aI) == aStr.charAt(aStr.length() - aI - 1)) {
                // 何もしない
            } else {
                aCount++;
            }

 

            aI++;
        }

 

        System.out.println(aCount);
    }
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: 'n' was not declared in this scope
    8 |   for(int i=0; i<n/2; i++){
      |                  ^
Language: C++

s = list(input())

s_r = s[::-1]

ans = 0
for i in range(len(s)//2):
	if s[i] != s_r[i]:
		ans += 1

print(ans)

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = list(input())
      | ^
Language: C

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

int main() {
	int a[101];
scanf("%s",a);

int len=strlen(s);

int count =0;

if (len % 2 == 0) {
        for (int i = 0; i < len / 2; i++) {
            if (s[i] != s[len - 1 - i]){
                count++;}
        }
    } else {
        for (int i = 0; i < (len - 1) / 2; i++) {
            if (s[i] != s[len - 1 - i]) {
                count++;
            }
        }
    }
    printf("%d", count);
	return 0;

Compiler output:
main.c: In function 'main':
main.c:9:16: error: 's' undeclared (first use in this function)
    9 | int len=strlen(s);
      |                ^
main.c:9:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:26:9: error: expected declaration or statement at end of input
   26 |         return 0;
      |         ^~~~~~
Language: C++

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

int main(){
  string str;
  int A = 0;
  cin >> str;
  for(int i = 0; i < 100; i++){
    for(int j = str.size(); j >= 0; j--){
      if(strA.at(i) != strA.at(j-1)){
        A++;
      }
    }
  }
  cout << A/2 << endl;    
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'strA' was not declared in this scope; did you mean 'str'?
   10 |       if(strA.at(i) != strA.at(j-1)){
      |          ^~~~
      |          str
Language: C++

S = str(input())

nrs = list(S)
cnt=0
N= len(nrs)
for i in range(N//2):
  if nrs[i]!=nrs[N-i-1]:
    cnt+=1
  

print(cnt)


Compiler output:
a.cc:1:1: error: 'S' does not name a type
    1 | S = str(input())
      | ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
string s;
  cin>>s;
  int i,n,c;
  c=0;
  n=strlen(s);
  if(n%2==0)
  {
    for(i=0;i<(n/2-1);i++)
    {
      if(a[i]!=a[n-1-i])
        c++;
    }
  }
  else
  {for(i=0;i<(n/2);i++)
  {
    if(a[i]!=a[n-1-i])
      c++;
  }
  }
  cout<<c;
  return 0;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: 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>
a.cc:14:10: error: 'a' was not declared in this scope
   14 |       if(a[i]!=a[n-1-i])
      |          ^
a.cc:21:8: error: 'a' was not declared in this scope
   21 |     if(a[i]!=a[n-1-i])
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;int p=0;
  int l=s.length();
  for(int i=0;i<l/2-1;i++)
  {
    if(a[i]!=a[l-1-i])
      p++;
  }
  cout<<p;
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;
signed main(){
string a;
  cin>>a;
  int b=0;
  if(a.size()%2==0){
  rep(i,a.size()/2){
  if(a[i]!=a[a.size()-1-i)])
    b++;
  }
    cout<<b;
  }
    else{
      rep(i,a.size()/2-1){
  if(a[i]!=a[a.size()-1-i)])
    b++;
  }
    cout<<b;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:26: error: expected ']' before ')' token
   22 |   if(a[i]!=a[a.size()-1-i)])
      |                          ^
      |                          ]
a.cc:22:27: error: expected primary-expression before ']' token
   22 |   if(a[i]!=a[a.size()-1-i)])
      |                           ^
a.cc:29:26: error: expected ']' before ')' token
   29 |   if(a[i]!=a[a.size()-1-i)])
      |                          ^
      |                          ]
a.cc:29:27: error: expected primary-expression before ']' token
   29 |   if(a[i]!=a[a.size()-1-i)])
      |                           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
bool isPalindrome(string s)
{
 string v;
  int n=s.length();
  for(int i=n-1;i>=0;--i)
  {
    v[i]=s[i];
  }
  for(int i=0;i<n;++i)
  {
    if(v[i]!=s[i])
      return false;
  }
  return true;
}
int main(){
  string s;
  cin>>s;
  int hugs=0,i,j;
  int n=s.length();
  for(i=0;i<n;++i)
  {
    if(s[i]!=s[n-1-i] hugs++;
  }
       cout<<hugs/2<<endl;
 /* if(isPalindrome(s))
    cout<<hugs<<endl;
  else 
  {
    for(i=0,j=n;i<n/2,j>n/2;++i,--j)
    {
      if(s[i]!=s[j]) hugs++;
    }
        cout<<hugs<<endl;
  }*/
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: expected ';' before 'hugs'
   26 |     if(s[i]!=s[n-1-i] hugs++;
      |                      ^~~~~
      |                      ;
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:30: error: expected ')' before '}' token
   26 |     if(s[i]!=s[n-1-i] hugs++;
      |       ~                      ^
      |                              )
   27 |   }
      |   ~                           
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
bool isPalindrome(string s)
{
 string v;
  int n=s.length();
  for(int i=N-1;i>=0;--i)
  {
    v[i]=s[i]
  }
  for(int i=0;i<n;++i)
  {
    if(v[i]!=s[i])
      return false;
  }
  return true;
}
int main(){
  string s;
  cin>>s;
  int hugs=0,i,j;
  int N=s.length();
  if(isPalindrome(s))
    cout<<hugs<<endl;
  else 
  {
    for(i=0,j=N;i<n/2,j>n/2;++i,--j)
    {
      if(s[i]!=s[j]) hugs++;
    }
        cout<<hugs<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'bool isPalindrome(std::string)':
a.cc:8:13: error: 'N' was not declared in this scope
    8 |   for(int i=N-1;i>=0;--i)
      |             ^
a.cc:10:14: error: expected ';' before '}' token
   10 |     v[i]=s[i]
      |              ^
      |              ;
   11 |   }
      |   ~           
a.cc: In function 'int main()':
a.cc:28:19: error: 'n' was not declared in this scope
   28 |     for(i=0,j=N;i<n/2,j>n/2;++i,--j)
      |                   ^
Language: C++

using namespace std;
#define ll long long
#include <iostream>
#include <bits/stdc++.h>

int main(){
    string s;
    cin >> s;
    char a[s.size()];
    for ( int i = 0; i < s.size(); i ++ ){
        a[i] = s[i];
    }
    int res = 0;
    for ( int i = 0; < s.size() / 2; i ++ ){
        if ( a[i] != a[s.size() - 1 - i ] ) res ++;
    }
    cout << res;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: expected primary-expression before '<' token
   14 |     for ( int i = 0; < s.size() / 2; i ++ ){
      |                      ^
Language: C++

#include<iostream>
using namespace std;

int main() {

	char S[101];
	cin >> S;
	int res = 0;
	int size = strlen(S); //文字列の数を取得
	cout << size << endl;
	for (int i = 0; i < size/2; ++i) {
		if (S[i] != S[size - (1 + i)]) ++res;
	}
	cout << res << endl;
	return 0;
}

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

#include<bits/stdc++.h>
#include<string.h>
#include<vector>
#define endl  "\n"
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cin.exceptions(cin.failbit);
using namespace std;
int main()
{
	string s;
	cin >> s;
	int cnt=0;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]!=s[n-1-i])
		{
			cnt++;
		}
	}
	cout << cnt;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: 'n' was not declared in this scope
   15 |                 if(s[i]!=s[n-1-i])
      |                            ^
Language: C++

#include<bits/stdc++.h>
#include<string.h>
#include<vector>
#define endl  "\n"
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cin.exceptions(cin.failbit);
using namespace std;
int main()
{
	string s;
	cin >> s;
	int cnt=0;
	for(int i=0;i<n;i++)
	{
		if(s[i]!=s[n-1-i])
		{
			cnt++;
		}
	}
	cout << cnt;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: 'n' was not declared in this scope
   13 |         for(int i=0;i<n;i++)
      |                       ^
Language: C++

/*
 *  AUTHOR : MANAV PATEl
*/
#include<bits/stdc++.h>
#include<functional>
//#include<boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
using namespace std;

namespace fastio {

	template <class T> istream &operator>>(istream &os, vector<T> & vec) {
		for (auto &u : vec)os >> u;
		return os;
	}
	template <class T> ostream &operator<<(ostream &os, const vector<T> & vec) {
		for (auto &u : vec)os << u << " ";
		return os;
	}
	template<class T1, class T2> inline istream& operator>>(istream& os, pair<T1, T2>& p) {
		return os >> p.first >> p.second;
	}
	template<class T1, class T2> ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
		return os << p.first << " " << p.second;
	}
	template <class T> ostream &operator<<(ostream &os, set<T> & con) {
		for (auto &u : con) os << u << " ";
		return os;
	}
	void re() {}
	template <typename T, typename... args> void re(T& x, args&... tail) {
		cin >> x;
		re(tail...);
	}
	void pr() {}
	template <typename T> void pr(const T& x) {
		cout << x;
	}
	template <typename T, typename... args> void pr(const T& x, const args&... tail) {
		cout << x << " ";
		pr(tail...);
	}
	template <typename... args> void prln(const args&... tail) {
		pr(tail...);
		cout << "\n";
	}
}
using namespace fastio;

typedef long long int ll;
typedef long double ld;

const ll mod = 1e9+7;
const ll mod1 = 998244353;

#define fill(a)  memset(a, 0, sizeof(a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back

int main()
{
	cin.sync_with_stdio(false);
	cin.exceptions(cin.failbit);
	cin.tie(0);
	string s;
	re(s);
	int cnt = 0;
	for(int i = 0; i < s.size()/2; i++)
	{
		if(s[i]!=s[n-i-1])
			cnt++;
	}
	cout<<cnt<<"\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:28: error: 'n' was not declared in this scope
   72 |                 if(s[i]!=s[n-i-1])
      |                            ^
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<queue>
#include<map>
#include<stack>
#include<fstream>
#include<stdlib.h>
#include<set>
#include<climits>
#include<cmath>  
#include<memory.h> 
#include<sstream>
#include<time.h>
#include<iomanip>
using namespace std;
const unsigned long long BIGEST=1000000000000000000+1000000000000000000;
const long long BIGER=1000000000000000000;
const int BIG=1000000000;
const long long MOD=1004535809;
const long long LMOD=154590409516822759;
//const long long LMOD=1000000007;
#define Fi first
#define Se second
#define P2 pair
#define Pii pair<int,int>
#define Pll pair<long long,long long>
#define Cb make_pair
#define ll long long
#define Ull unsigned long long
#define Sf scanf
#define Pf printf
#define Pb push_back
#define Psh push
#define Stc stack
#define Vct vector
#define Ret return
#define Re0 return 0
#define Sz size
#define Is insert
#define Que queue
#define Emp empty
#define Fro front
#define Rv reverse
#define Er erase
#define Bg begin
#define Srt sort
#define Pq priority_queue
#define Ins insert
#define Ite iterator
#define Cou count
#define Cot continue
#define Beg begin
int main()
{
	string st;
	cin>>st;
	int t==0;
	for(int i=0;i<st.Sz();i++)
	{
		t+=((st[st.Sz()-i-1]!=st[i])?1:0);
	}
	cout<<t/2;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:14: error: expected initializer before '==' token
   61 |         int t==0;
      |              ^~
a.cc:64:17: error: 't' was not declared in this scope
   64 |                 t+=((st[st.Sz()-i-1]!=st[i])?1:0);
      |                 ^
a.cc:66:15: error: 't' was not declared in this scope; did you mean 'st'?
   66 |         cout<<t/2;
      |               ^
      |               st
Language: Java

import java.util.*;

public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int a = s.length();

    int num = 0;

    for(int i=0; i<s/2; i++){
       if(s.charAt(i) != s.charAt(a-i-1)){
         num++;
       }
    }
    System.out.println(num);
  }
}

Compiler output:
Main.java:13: error: bad operand types for binary operator '/'
    for(int i=0; i<s/2; i++){
                    ^
  first type:  String
  second type: int
1 error
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
  string s;
  cin>>s;
  long int l=s.size();
  long int count=0;
  for(int i=0,j=l-1;i<l/2,j>l/2;i++,j--)
    if(a[i]!=a[j])
      count++;
  cout<<count;
}

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

#include<iostream>
#include<string>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int l=s.size();
  int count=0;
  for(int i=0,j=l-1;i<l/2,j>l/2;i++,j--)
    if(a[i]!=a[j])
      count++;
  cout<<count;
}

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

#include <iostream>


using namespace std;


int main(){
  	std::string s;
  
  	int cnt = 0;
  	const int size = str.size();
  	for (int i=0; i<size/2; i ++){
      	if (str[i] != str[size-1-i])
          	cnt ++;     
    }
  	std::cout<<cnt;
  
  
  
 	return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: 'str' was not declared in this scope; did you mean 'std'?
   11 |         const int size = str.size();
      |                          ^~~
      |                          std
Language: C++

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

int main(){
    string S;
    cin >> S;
    int count = 0;
    for(int i=0;i<S.size();S++){
    if(S[i] != S[S.size()-1-i]){
        count += 1;
    }
    }
    cout << count;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    9 |     for(int i=0;i<S.size();S++){
      |                            ~^~
Language: C++

#include<iostream>
using namespace std;

int main(){
    cin >> S;
    int count = 0;
    for(int i=0;i<S.size();S++){
    if(S[i] != S[S.size()-1-i]){
        count += 1;
    }
    }
    cout << count;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:12: error: 'S' was not declared in this scope
    5 |     cin >> S;
      |            ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i <(n) ; ++i)
#define PI 3.14159265
#define INF 2147483647
using namespace std;
using ll = long long;
void self_max(int &a,int b){
	a = max(a,b);
}
void self_min(int &a,int b){
	a = min(a,b);
}

int main(){
	String s; cin >> s;
	int n = s.size();
	int l,r;
	if(n&1){
		l = n/2-1;
		r = n/2+1;
	}else{
		l = n/2 -1;
		r = n/2;
	}
	int count = 0;
	while(l>=0 && r <n){
		if(s[l] != s[r]) count++;
		--l;
		++r;
	}

	cout << count << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'String' was not declared in this scope
   15 |         String s; cin >> s;
      |         ^~~~~~
a.cc:15:26: error: 's' was not declared in this scope
   15 |         String s; cin >> s;
      |                          ^
Language: Java

import java.util.Scanner;

public class ABC_147B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a1;
        int num = 0;

        String s = sc.nextLine();
        a1 = s.length();

        for(int i =0; i < a1/2; i++){
            if(s.charAt(i) != s.charAt(a1-i-1)){
                num++;
            }
        }
        System.out.println(num);

            // write your code here
    }

}


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

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

int main()
{
  string s;
  cin>>s;
  int count=0;
  int n=s.size();
  for(int i=0;i<(n/2);i++)
  {
    if(s[i]!=s[n-1-i]
       count++;
       }
       cout<<count;
       return 0;
       }

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expected ';' before 'count'
   12 |     if(s[i]!=s[n-1-i]
      |                      ^
      |                      ;
   13 |        count++;
      |        ~~~~~          
a.cc:14:8: error: expected primary-expression before '}' token
   14 |        }
      |        ^
a.cc:13:16: error: expected ')' before '}' token
   13 |        count++;
      |                ^
      |                )
   14 |        }
      |        ~        
a.cc:12:7: note: to match this '('
   12 |     if(s[i]!=s[n-1-i]
      |       ^
a.cc:14:8: error: expected primary-expression before '}' token
   14 |        }
      |        ^
Language: C++

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

int main() {
  string s;
  cin >> s;
  
  int n = s.size();
  
  int ans = 0;
  
  for (int i = 0; i < n / 2; i++) {
    if (s[i] != s[(n-1) - i]) {
      ans++
    }
  }
  cout << ans << endl;
  
  retrun 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: expected ';' before '}' token
   15 |       ans++
      |            ^
      |            ;
   16 |     }
      |     ~       
a.cc:20:3: error: 'retrun' was not declared in this scope
   20 |   retrun 0;
      |   ^~~~~~
Language: C++

#include <iostream>

using namespace std;

int main(){
  int c=0;
  string s,r;
  cin >> s;
  reverse_copy(s.begin(), s.end(), r);
  for(int i=0;i<s.length()/2;i++){
    c += (s[i]==r[i] ? 0 : 1);
  }
  
  cout << c << endl;
  
  return 0;
}

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

#include <iostream>

using namespace std;

int main(){
  int c=0;
  string s,r;
  cin >> s;
  r = reverse(s.begin(), s.end());
  for(int i=0;i<s.length()/2;i++){
    c += (s[i]==r[i] ? 0 : 1);
  }
  
  cout << c << endl;
  
  return 0;
}

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

#include <iostream>

using namespace std;

int main(){
  int c=0;
  string s,r;
  cin >> s;
  r = reverse(s.begin(), s.end());
  for(int i=0;i<s.length()/2;i++){
    c += (s[i]==r[i] ? 0 : 1)
  }
  
  cout << c << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'reverse' was not declared in this scope
    9 |   r = reverse(s.begin(), s.end());
      |       ^~~~~~~
a.cc:11:30: error: expected ';' before '}' token
   11 |     c += (s[i]==r[i] ? 0 : 1)
      |                              ^
      |                              ;
   12 |   }
      |   ~
Language: C++

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

int main(){
  string s;
  cin >> s;
  string sv = reverse(s);
  int count = 0;
  for(int i = 0; i < s.size(); i++){
    if(s.at(i) != sv.at(i)) count++;
  }
  cout << count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: no matching function for call to 'reverse(std::string&)'
    7 |   string sv = reverse(s);
      |               ~~~~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)'
 1083 |     reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
      |     ^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1083:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)'
  249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last);
      | ^~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note:   candidate expects 3 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
#define ll long long 
#define endl '\n'
#define debug(x)  cout<<x<<" ";
#define for(i,n) for(i=0;i<n;i++)
#define fastInOut   ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0);
using namespace std;

int main() {
    fastInOut
    string s;
    cin>>s;
    int c=0;
    for(int i=0;j=s.size()-1;i<j;i++,j--)
       if(s[i]!=s[j])
          c++;
          cout<<c;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'j' was not declared in this scope
   14 |     for(int i=0;j=s.size()-1;i<j;i++,j--)
      |                 ^
a.cc:5:22: note: in definition of macro 'for'
    5 | #define for(i,n) for(i=0;i<n;i++)
      |                      ^
a.cc:14:33: error: expected ')' before ';' token
   14 |     for(int i=0;j=s.size()-1;i<j;i++,j--)
      |                                 ^
a.cc:5:22: note: in definition of macro 'for'
    5 | #define for(i,n) for(i=0;i<n;i++)
      |                      ^
a.cc:5:21: note: to match this '('
    5 | #define for(i,n) for(i=0;i<n;i++)
      |                     ^
a.cc:14:5: note: in expansion of macro 'for'
   14 |     for(int i=0;j=s.size()-1;i<j;i++,j--)
      |     ^~~
a.cc:14:34: error: 'i' was not declared in this scope
   14 |     for(int i=0;j=s.size()-1;i<j;i++,j--)
      |                                  ^
a.cc:5:22: note: in definition of macro 'for'
    5 | #define for(i,n) for(i=0;i<n;i++)
      |                      ^
a.cc:14:17: error: 'j' was not declared in this scope
   14 |     for(int i=0;j=s.size()-1;i<j;i++,j--)
      |                 ^
a.cc:5:26: note: in definition of macro 'for'
    5 | #define for(i,n) for(i=0;i<n;i++)
      |                          ^
Language: C++

#include<iostream>
using namespace std;
int main(int argc, char const *argv[])
{
   string s;
   cin >> s;
   int ans = 0;
   for(int i = 0; i < s.length()/2; i++){
      if(s[i] != s[s.length - i -1])
         ans++;
   }
   cout << ans << endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:9:22: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    9 |       if(s[i] != s[s.length - i -1])
      |                    ~~^~~~~~
      |                            ()
Language: C++

#include<iostream>
using namespace std;
int main(int argc, char const *argv[])
{
   string s;
   cin >> s;
   int ans = 0;
   for(int i = 0; i < s.length/2; i++){
      if(s[i] != s[s.length - i -1])
         ans++;
   }
   cout << ans << endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:8:25: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    8 |    for(int i = 0; i < s.length/2; i++){
      |                       ~~^~~~~~
      |                               ()
a.cc:9:22: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    9 |       if(s[i] != s[s.length - i -1])
      |                    ~~^~~~~~
      |                            ()
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int count=0;
  string S;
  cin >> S;
  if(S==V){
    cout<<0<<endl;
  }else{
    int c = S.length;
    for(int i=0; i<c;i++){
      if(S[i] != S[c-1-i]){
        S[c-1-i] = S[i];
        count ++;
      }
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'V' was not declared in this scope
    7 |   if(S==V){
      |         ^
a.cc:10:15: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
   10 |     int c = S.length;
      |               ^~~~~~
Language: C

#include <stdio.h>
int main(void){
    int hugcount, i, j, x;
    char S[100];
    
    scanf("%s", &S);
    
    for(i=0, S[i] != 0, i++);
    
    x = (i+1)/2;
    
    for(j=0, j < x, j++){
        if(s[j] != s[i]){
            s[j] = s[i];
        }
        i--;
    }

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:28: error: expected ';' before ')' token
    8 |     for(i=0, S[i] != 0, i++);
      |                            ^
      |                            ;
main.c:8:28: error: expected expression before ')' token
main.c:12:24: error: expected ';' before ')' token
   12 |     for(j=0, j < x, j++){
      |                        ^
      |                        ;
main.c:12:24: error: expected expression before ')' token
main.c:13:12: error: 's' undeclared (first use in this function)
   13 |         if(s[j] != s[i]){
      |            ^
main.c:13:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
using namespace std;

int main(){
  string s;
  int a,n=0;
  char c;
  
  
  cin>>s;
  a=s.size();
  for(int i=0;i<a;i++){
    if (s.at(i)==s.at(a-i-1)){
      continue;
    }else{n++;}
    }
  }
  cout<<n<<endl;
}

Compiler output:
a.cc:18:3: error: 'cout' does not name a type
   18 |   cout<<n<<endl;
      |   ^~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  string s;
  int a,n=0;
  char c;
  
  
  cin>>s;
  a=s.size();
  for(i=0;i<a;i++){
    if (s.at(i)==s.at(a-i-1)){
      continue;
    }else{n++;}
    }
  }
  cout<<n<<endl;
}

          
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i=0;i<a;i++){
      |       ^
a.cc: At global scope:
a.cc:18:3: error: 'cout' does not name a type
   18 |   cout<<n<<endl;
      |   ^~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  string s;
  int a,n=0;
  char c;
  
  
  cin>>s;
  a=s.size();
  for(i=0;i<a;i++){
    if (s.at(i)==s.at(a-i)){
      continue;
    }else{n++;}
    }
  }
  cout<<n<<endl;
}

          
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i=0;i<a;i++){
      |       ^
a.cc: At global scope:
a.cc:18:3: error: 'cout' does not name a type
   18 |   cout<<n<<endl;
      |   ^~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  string s;
  int a,n=0;
  char c;
  
  
  cin>>s;
  a=s.size();
  for(i=0;i<a;i++){
    if (s.at(i)==s.at(a-i)){
      continue;
    }else{
      n++;
      for(j=i+1;j<a-i;j++){
        if(s.at(a-i)==s.at(j)){
          c=s.at(i);
          s.at(i)=s.at(j);
          s.at(j)=c;
        }else{continue;}
      }
    }
  }
  cout<<n<<endl;
}

          
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i=0;i<a;i++){
      |       ^
a.cc:17:11: error: 'j' was not declared in this scope
   17 |       for(j=i+1;j<a-i;j++){
      |           ^
Language: C++

#include <iostream>

using namespace std;

int main(void) {
	ios::sync_with_stdio(false);
	cin.tie(0);
	string str1;
	cin >> str1;
	int len = str1.length(), cnt = 0;
	for (int i = 0; i < len; i++) {
		if (str1[i] != str[len-1-i]) {
			cnt++;
		}
	}
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:32: error: 'str' was not declared in this scope; did you mean 'str1'?
   12 |                 if (str1[i] != str[len-1-i]) {
      |                                ^~~
      |                                str1
Language: C++

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

void change(string s) 
{ 
  
    // Finding the length of the string  
    int n = s.length();  
  
    // To store the number of replacement operations  
    int cc = 0; 
  
    for(int i=0;i<n/2;i++) 
    { 
  
        // If the characters at location  
        // i and n-i-1 are same then  
        // no change is required  
        if(s[i]== s[n-i-1])  
            continue; 
  
        // Counting one change operation  
        cc+= 1; 
  
        // Changing the character with higher  
        // ascii value with lower ascii value  
        if(s[i]<s[n-i-1])  
            s[n-i-1]= s[i] ; 
        else
            s[i]= s[n-i-1] ; 
    } 
    printf("Minimum characters to be replaced = %d\n", (cc)) ; 
    cout<<s<<endl;  
}

int main()
{
  	string s;
  cin>>s;
  change(s);
}

Compiler output:
a.cc:1:23: error: missing terminating > character
    1 | #include<bits/stdc++.h
      |                       ^
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class InputSample {
    public static void Main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String str = "";
        try {
            str = reader.readLine();
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
      
      int right = str.length()-1;
      int left = 0;
      
      int ret = 0;
      
      while(left<right){
        char leftchr = str.charAt(left);
        char rightchr = str.charAt(right);
        if(leftchr != rightchr) ret++;
        left++;
        right--;
        
      }
      
      System.out.println(ret.toString());
      
    }
}

Compiler output:
Main.java:5: error: class InputSample is public, should be declared in a file named InputSample.java
public class InputSample {
       ^
Main.java:30: error: int cannot be dereferenced
      System.out.println(ret.toString());
                            ^
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class InputSample {
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String str = "";
        try {
            String str = reader.readLine();
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
      
      int right = str.length()-1;
      int left = 0;
      
      int ret = 0;
      
      while(left<right){
        char leftchr = str.charAt(left);
        char rightchr = str.charAt(right);
        if(leftchr != rightchr) ret++;
        left++;
        right--;
        
      }
      
      System.out.println(ret.toString());
      
    }
}

Compiler output:
Main.java:5: error: class InputSample is public, should be declared in a file named InputSample.java
public class InputSample {
       ^
Main.java:10: error: variable str is already defined in method main(String[])
            String str = reader.readLine();
                   ^
Main.java:30: error: int cannot be dereferenced
      System.out.println(ret.toString());
                            ^
3 errors
Language: C++

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

long long cnt;

int main() {
  string s;
  cin >> s;
  for (int i = 0; i <= s.size() / 2; i++)
  	if (s[i] != s[n - i - 1])
  		cnt++;
  cout << cnt << '\n';
 	return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: 'n' was not declared in this scope
   10 |         if (s[i] != s[n - i - 1])
      |                       ^
Language: C++

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


int main() {
  string S;
  cin >> S;
  int count =0;
  for(int i=0;i<S.size()/2;i++){
    if(S[i]==S[S.size()-i]){
      continue;
    }else{
      count++;
    }
    cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: Java

import java.util.*;

class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();

    char[] ch = new char[s.length()];
    int count = 0;

    for(int i=0; i<s.length(); i++){
       ch[i] = s.charAt(i);
    }

    int a =(s.length())%2;

    if(a == 0){
       for(int j=0; j<(s.length())/2; j++){
          if(ch[j] != ch[s.length()-j]){
             count++;
          }else{
             continue;
          }
       }
    }

    else if(a != 0){
       for(int j=0; j<((s.length()-1)/2; j++){
          if(ch[j] != ch[s.length()-j]){
             count++;
          }else{
             continue;
          }
       }
    }
    System.out.println(count);
  }
}


Compiler output:
Main.java:30: error: ')' expected
       for(int j=0; j<((s.length()-1)/2; j++){
                                       ^
1 error
Language: Java

import java.util.*;

class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();

    char[] ch = new char[s.length()];
    int count = 0;

    for(int i=0; i<s.length(); i++){
       ch[i] = s.charAt(i);
    }

    int a =(s.length())%2;

    if(a == 0){
       for(int j=0; j<(s.length())/2){
          if(ch[j] != ch[s.length()-j]){
             count++;
          }else{
             continue;
          }
       }
    }

    else if(a != 0){
       for(int j=0; j<((s.length()-1)/2){
          if(ch[j] != ch[s.length()-j]){
             count++;
          }else{
             continue;
          }
       }
    }
    System.out.println(count);
  }
}

Compiler output:
Main.java:20: error: ';' expected
       for(int j=0; j<(s.length())/2){
                                    ^
Main.java:30: error: ';' expected
       for(int j=0; j<((s.length()-1)/2){
                                        ^
2 errors
Language: C++

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


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

	int len = S.length();
	int cnt = 0;
	for (int i = 0; i < len / 2; i++) {
		if (S[i] != S[len - i - 1]) {
			cnt++;
		}
	}
	cout << cnt << endl;

	return 0;
}#include <iostream>
#include <string>
#include <algorithm>
using namespace std;


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

	int len = S.length();
	int cnt = 0;
	for (int i = 0; i < len / 2; i++) {
		if (S[i] != S[len - i - 1]) {
			cnt++;
		}
	}
	cout << cnt << endl;

	return 0;
}

Compiler output:
a.cc:22:2: error: stray '#' in program
   22 | }#include <iostream>
      |  ^
a.cc:22:3: error: 'include' does not name a type
   22 | }#include <iostream>
      |   ^~~~~~~
a.cc:28:5: error: redefinition of 'int main()'
   28 | int main()
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main()
      |     ^~~~
Language: C++

#include <iostream>
#include <string>
#
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)


int main() {
  string s,s1;
  int cnt=0;

  cin>>s;
  s1=s;
  reverse(s1.begin(),s1.end());
  r(i,s.size()/2){
    if(s.at(i)!=s1.at(i))cnt++;
  }

  cout<<cnt<<endl;



return 0;
}


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

import java.util.Scanner;

public class BC147_B {
    //Palindrome-philia
    //改变最少的字符来使得字符串变成回文
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        System.out.println(helper(s));
        sc.close();
    }

    static int helper(String s) {
        int lo = 0, hi = s.length() - 1;
        int count = 0;
        while (lo < hi) {
            if (s.charAt(lo) != s.charAt(hi)) count++;
            lo++;
            hi--;
        }
        return count;
    }
}


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

#include<stdio.h>
#include<string.h>
int main()
{
	char s[110];
	gets(s);
	int len = strlen(s);
	int cnt = 0;
	for(int i=0; i<len/2; i++)
	{
		if(s[i]!=s[len-i-1]) cnt++;
	}
	printf("%d\n", cnt);
	return 0;
 } 

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

#include<cstdio>
#include<cstring>
int main()
{
	char s[110];
	gets(s);
	int len = strlen(s);
	int cnt = 0;
	for(int i=0; i<len/2; i++)
	{
		if(s[i]!=s[len-i-1]) cnt++;
	}
	printf("%d\n", cnt);
	return 0;
 } 

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

import java.util.Scanner;
public class PalindromePhilia{
    public static void main(String args[]){
        int cnt=0;
        Scanner sc=new Scanner(System.in);
        String a=sc.next();        
        for(int i=0;i<a.length()/2;i++){
            if(a.charAt(i)!=a.charAt(a.length()-1-i)){
                cnt++;
            }
        }

        System.out.println(cnt);
    }
}

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

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

int main() {
  string s;
  cin>>s;
  int a=s.size();
  int cnt=0;
  int m;
  if (a%2==0) {
    m=n/2;
  } else {
    m=(a+1)/2;
  }
  for (int i=0;i<m;++i) {
    if (s[i]!=s[a-i]) {
      cnt+=1
    }
  }
  cout<<cnt<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'n' was not declared in this scope
   11 |     m=n/2;
      |       ^
a.cc:17:13: error: expected ';' before '}' token
   17 |       cnt+=1
      |             ^
      |             ;
   18 |     }
      |     ~
Language: C++

#include<bits/stdc++.h> 
using namespace std; 
  
// Function to find the minimum number  
// character change required  
   
void change(string s) 
{ 
  
    // Finding the length of the string  
    int n = s.length();  
  
    // To store the number of replacement operations  
    int cc = 0; 
  
    for(int i=0;i<n/2;i++) 
    { 
  
        // If the characters at location  
        // i and n-i-1 are same then  
        // no change is required  
        if(s[i]== s[n-i-1])  
            continue; 
  
        // Counting one change operation  
        cc+= 1; 
  
        // Changing the character with higher  
        // ascii value with lower ascii value  
        if(s[i]<s[n-i-1])  
            s[n-i-1]= s[i] ; 
        else
            s[i]= s[n-i-1] ; 
    } 
    printf((cc)) ; 
} 
// Driver code  
int main() 
{ 
string s = "geeks"; 
change((s)); 
return 0; 
} 

Compiler output:
a.cc: In function 'void change(std::string)':
a.cc:35:13: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   35 |     printf((cc)) ;
      |            ~^~~
      |             |
      |             int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	int len;
	int cnt=0;
	cin>>s;
 	len=str.length();
  for(int i=0;i<len/2;i++){
		if(str[i]!=s[len-i-1]){
			cnt++;
		}
	}
 
	cout<<cnt<<endl;
 
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'str' was not declared in this scope; did you mean 'std'?
    8 |         len=str.length();
      |             ^~~
      |             std
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin >> s;
    int n = s.size();
    int count = 0;
    for(int i=0;i<2/n;i++){
        if s[i] != s[n-i]{
            count++;
        }
    }
    cout << count <<"\n";

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected '(' before 's'
    9 |         if s[i] != s[n-i]{
      |            ^
      |            (
Language: C++

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

 int main(){
   string S;
   cin>>S;
   int cnt=0;
   for(int i=0;i<s.size()/2;i++){
     if(s[i] != s.size()-1-i)cnt++;
   }
   cout<<cnt;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: 's' was not declared in this scope
    8 |    for(int i=0;i<s.size()/2;i++){
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
  
{ string h;
 getline(cin,h);int k=0;
 int g=strlen(h);
 for(int i=0;i<g/2;i++)
 {if (h[i]==h[g-i-1])
    continue;
  else 
    {k++;
    }
 
 
 
 
 }

cout<<k;


return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
    7 |  int g=strlen(h);
      |               ^
      |               |
      |               std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C++

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

int main(){
	string s;
  	cin>>s;
  	int len = s.length();
  	if(len%2==0){
  		string s1 = s.substr(0, len/2);
  		string s2 = s.substr(len/2, len/2);
  		int count = 0;
  		for(int i=0;i<len/2;i++){
  			if(s1[i] ! = s2[len/2 - i - 1])
  				count++;
  		}
  		cout<<count;
  	}
  	else{
  		string s1 = s.substr(0, len/2);
  		string s2 = s.substr(len/2 + 1, len/2);
  		int count = 0;
  		for(int i=0;i<len/2;i++){
  			if(s1[i] ! = s2[len/2 - i - 1])
  				count++;
  		}
  		cout<<count;
  	}
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:33: error: expected ')' before '!' token
   13 |                         if(s1[i] ! = s2[len/2 - i - 1])
      |                           ~     ^~
      |                                 )
a.cc:23:33: error: expected ')' before '!' token
   23 |                         if(s1[i] ! = s2[len/2 - i - 1])
      |                           ~     ^~
      |                                 )