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

#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,N) for(int i = 0;i < (int)(N);i++)
int main(){
  string s;
  int x=0;
  rep(i,n){
      if(s[i]!=s[n-i]) x++;
    }
  cout<<x/2<<endl;  
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'n' was not declared in this scope
    9 |   rep(i,n){
      |         ^
a.cc:5:42: note: in definition of macro 'rep'
    5 | #define rep(i,N) for(int i = 0;i < (int)(N);i++)
      |                                          ^
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
  int ans,i,n;
  char a[100];
  scanf("%s",a);
  n=strlen(a);
  for(i=0;i<n;i++){
    if(strncmp(a[i],a[n-i-1])!=0) ans++;
  }
   printf("%D",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:17: error: passing argument 1 of 'strncmp' makes pointer from integer without a cast [-Wint-conversion]
    9 |     if(strncmp(a[i],a[n-i-1])!=0) ans++;
      |                ~^~~
      |                 |
      |                 char
In file included from main.c:2:
/usr/include/string.h:159:33: note: expected 'const char *' but argument is of type 'char'
  159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n)
      |                     ~~~~~~~~~~~~^~~~
main.c:9:22: error: passing argument 2 of 'strncmp' makes pointer from integer without a cast [-Wint-conversion]
    9 |     if(strncmp(a[i],a[n-i-1])!=0) ans++;
      |                     ~^~~~~~~
      |                      |
      |                      char
/usr/include/string.h:159:51: note: expected 'const char *' but argument is of type 'char'
  159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n)
      |                                       ~~~~~~~~~~~~^~~~
main.c:9:8: error: too few arguments to function 'strncmp'
    9 |     if(strncmp(a[i],a[n-i-1])!=0) ans++;
      |        ^~~~~~~
/usr/include/string.h:159:12: note: declared here
  159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n)
      |            ^~~~~~~
Language: C++

function Main (S) {
  S = S.split("\n")[0].split("");
  var re = [];
  var ans = 0;
  for (var i of S) {
    re.unshift(i);
  }
  for (var i = 0; i < S.length; i++) {
    if (S[i] != re[i]) {
      ans++;
    }
  }
  console.log(ans/2);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Compiler output:
a.cc:1:1: error: 'function' does not name a type; did you mean 'union'?
    1 | function Main (S) {
      | ^~~~~~~~
      | union
a.cc:16:5: error: expected constructor, destructor, or type conversion before '(' token
   16 | Main(require("fs").readFileSync("/dev/stdin", "utf8"));
      |     ^
Language: C++

#include "stdafx.h" //プリインクルードされている場合はコメントアウト
#include <iostream>
#include <string>
#include <cstdlib> //func147bでインクルード

using namespace std;

size_t length(const string& str) {
    return str.length();
}
void func147b()
{

    string s;
    int hug = 0;
    cin >> s;
    
    for (int i = 0; i < length(s)/2; ++i) {
        if (s[i] != s[length(s) - 1 - i]) hug++;
    }
    cout << hug << endl;
}

int main()
{
  func147b();
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h" //プリインクルードされている場合はコメントアウト
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <bitset>
#include <list>
#include <cstdio>
#include <stdio.h>
#include <string.h>
#include <cmath>

typedef long long ll;

using namespace std;

ll gcd(ll a, ll b)
{
    if((a%b) == 0) return b;
    else return gcd(b, a%b);
}

int solve(string s)
{
    int n = s.length();
    if(s[0] == s[n]) solve(s.substr(1,(n-2)));
    else
    {
        ans++;
        solve(s.substr(1));
    }
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int ans = 0;
    solve(s);
    cout << ans;
}


Compiler output:
a.cc: In function 'int solve(std::string)':
a.cc:35:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |         ans++;
      |         ^~~
      |         abs
a.cc:38:1: warning: no return statement in function returning non-void [-Wreturn-type]
   38 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <bitset>
#include <list>
#include <cstdio>
#include <stdio.h>
#include <string.h>
#include <cmath>

typedef long long ll;

using namespace std;

ll gcd(ll a, ll b)
{
    if((a%b) == 0) return b;
    else return gcd(b, a%b);
}

int solve(string s)
{
    int n = s.length();
    if(s[0] == s[n]) solve(s.substr(1,(n-2)))
    else
    {
        ans++;
        solve(s.substr(1));
    }
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int ans = 0;
    solve(s);
    cout << ans;
}


Compiler output:
a.cc: In function 'int solve(std::string)':
a.cc:32:46: error: expected ';' before 'else'
   32 |     if(s[0] == s[n]) solve(s.substr(1,(n-2)))
      |                                              ^
      |                                              ;
   33 |     else
      |     ~~~~                                      
a.cc:38:1: warning: no return statement in function returning non-void [-Wreturn-type]
   38 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <bitset>
#include <list>
#include <cstdio>
#include <stdio.h>
#include <string.h>
#include <cmath>

typedef long long ll;

using namespace std;

ll gcd(ll a, ll b)
{
    if((a%b) == 0) return b;
    else return gcd(b, a%b);
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int ans = 0;
    
    int solve(string s)
    {
        int n = s.length();
        if(s[0] == s[n]) solve(s.substr(1,(n-2)))
        else
        {
            ans++;
            solve(s.substr(1));
        }
    }
    cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:5: error: a function-definition is not allowed here before '{' token
   38 |     {
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
string S;
  cin >> S;
  int ans=0;
  for(int i=0;i < S.size();++i){
  if(S.at(i) != S.at(S.size() -1 -i)
     ans++;
     
  
  }
cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:37: error: expected ';' before 'ans'
    9 |   if(S.at(i) != S.at(S.size() -1 -i)
      |                                     ^
      |                                     ;
   10 |      ans++;
      |      ~~~                             
a.cc:13:3: error: expected primary-expression before '}' token
   13 |   }
      |   ^
a.cc:10:12: error: expected ')' before '}' token
   10 |      ans++;
      |            ^
      |            )
......
   13 |   }
      |   ~         
a.cc:9:5: note: to match this '('
    9 |   if(S.at(i) != S.at(S.size() -1 -i)
      |     ^
a.cc:13:3: error: expected primary-expression before '}' token
   13 |   }
      |   ^
Language: C++

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

int main(){
string S;
  cin >> S;
  int ans=0;
  for(int i=0;i < S.size();++i){
  if(S.at(i) != S.at(S.size() -1 -i)
     ans++;
     
  
  }
cout << ans << endl;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespce'
    2 | using namespce std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'string' was not declared in this scope
    5 | string S;
      | ^~~~~~
a.cc:5:1: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 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/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> S;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:10: error: 'S' was not declared in this scope
    6 |   cin >> S;
      |          ^
a.cc:13:3: error: expected primary-expression before '}' token
   13 |   }
      |   ^
a.cc:10:12: error: expected ')' before '}' token
   10 |      ans++;
      |            ^
      |            )
......
   13 |   }
      |   ~         
a.cc:9:5: note: to match this '('
    9 |   if(S.at(i) != S.at(S.size() -1 -i)
      |     ^
a.cc:13:3: error: expected primary-expression before '}' token
   13 |   }
      |   ^
a.cc:14:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 | cout << ans << 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:14:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 | cout << ans << endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		String s = kb.next();
		int count = 0;
		for (int i = 0; i < s.length() / 2; i++) {
			if (s.charAt(i) != s.charAt(s.length() - i - 1))
				count += 1;
		}

		System.out.println(count);
		kb.close();
	}

}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |       ans++;
      |       ^~~
      |       abs
a.cc:10:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |   cout << ans;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


int main() {
string s;
cin >> s;
int s_size = strlen(s);
int ans = 0;
REP(i,s_size) {
  if(s[i]!=s[s_size-i-1]) ans ++;
}
cout << ans << endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   15 | int s_size = strlen(s);
      |                     ^
      |                     |
      |                     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<stdio.h>
#include<string.h>
int main(){
    char S;
    int count = 0;
    scanf("%s",S);
    int len = strlen(S);
    for(int i = 1 ; i < len/2 ; i++){
        if(S[i] != S[len]) count++;
    }
    printf("%d\n",count);
}


Compiler output:
main.c: In function 'main':
main.c:7:22: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
    7 |     int len = strlen(S);
      |                      ^
      |                      |
      |                      char
In file included from main.c:2:
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c:9:13: error: subscripted value is neither array nor pointer nor vector
    9 |         if(S[i] != S[len]) count++;
      |             ^
main.c:9:21: error: subscripted value is neither array nor pointer nor vector
    9 |         if(S[i] != S[len]) count++;
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define N 200100
#define pii pair<int,int>
#define rep(i,k,n) for(int i=k;i<n;i++)
#define vi vector<int>
#define inf 1e9
void solve(){
	string s;
	cin>>s;
	int len=s.length();
	ll ans=0;
	int j=len-1;
	for(int i=0;i<len/2;i++){
		if(s[i]!=s[j])
			ans++;
		j--;
	}
	cout<<ans<<endl;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);tput.txt","w+",stdout);
	solve();
}

Compiler output:
a.cc:26:36: warning: missing terminating " character
   26 |         cin.tie(NULL);tput.txt","w+",stdout);
      |                                    ^
a.cc:26:36: error: missing terminating " character
   26 |         cin.tie(NULL);tput.txt","w+",stdout);
      |                                    ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:26:23: error: 'tput' was not declared in this scope
   26 |         cin.tie(NULL);tput.txt","w+",stdout);
      |                       ^~~~
Language: C++

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

int main(){
  string s ;
  cin >> s ;
  int a,b;
  a = s.size();
  a--;
  b = 0;
  int count = 0;
  rep( i, s.size()/2 ){
    if( s[b] == s[a] ){
      b++; a--;
      continue;
    }
    else if( s[b] != s[a] ){
      count ++;
      b++; a--;
      continue;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

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

int main(){
  string s ;
  cin >> s ;
  int a,b;
  a = s.size();
  b = 0;
  int count = 0;
  rep(i, a/2){
    if( s[b] == s[a] ){
      b++; a--;
      continue;
    }
    else if( s[b] != s[a] ){
      count ++;
      b++; a--;
      continue;
  }
  cout << count << endl
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: expected ';' before '}' token
   24 |   cout << count << endl
      |                        ^
      |                        ;
   25 | }
      | ~                       
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

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

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


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

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

int main() {
    string s;
    cin >> s;
    string temp = s;
    int len = s.length();

    reverse(s.begin(), s.end());

    int count = 0;
    for(int i = 0; i < len; i++) {
        if(s[i] != temp[i]) count++;
    }

    cout << count / 2 << endl;

    return 0;
}a

Compiler output:
a.cc:22:2: error: 'a' does not name a type
   22 | }a
      |  ^
Language: C

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

int main(void) {
	int n;
	int l = 0;
	char s[101];
	scanf("%s", s);
	n = strlen(s);
	for (int i = 1;i < n;i++) {
		if (s[i]!=s[n+1-i])
		{
			l++;
		}
	}

	printf("%d", l / 2);
	return 0;
}

Compiler output:
main.c:2:10: fatal error: string: No such file or directory
    2 | #include <string>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include "bits/stdc++.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> Pll;
typedef pair<P,P> PP;
#define rep(i,a,n) for(ll i = a;i < n;i++)
#define repr(i,a,n) for(ll i = n-1;i >= a;i--)
#define LINF (ll)1e17
#define INF (int)1e9
#define MOD (ll)1e9+7
#define sMOD 1e5
#define fs first
#define sc second

ll gcd(ll a,ll b){
	if(!b) return a;
	return gcd(b,a%b);
	
}



signed main(){
	ll cnt = 0;
	string s;
	
	cin >> s;
	
	rep(i,0,s.size()/2){
		if(s[i] != s[n/2+i]) cnt++;
	}
	
	cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:30: error: 'n' was not declared in this scope
   32 |                 if(s[i] != s[n/2+i]) cnt++;
      |                              ^
Language: C++

#include "bits/stdc++.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> Pll;
typedef pair<P,P> PP;
#define rep(i,a,n) for(ll i = a;i < n;i++)
#define repr(i,a,n) for(ll i = n-1;i >= a;i--)
#define LINF (ll)1e17
#define INF (int)1e9
#define MOD (ll)1e9+7
#define sMOD 1e5
#define fs first
#define sc second

ll gcd(ll a,ll b){
	if(!b) return a;
	return gcd(b,a%b);
	
}



signed main(){
	ll cnt = 0;
	string s;
	
	cin >> s;
	
	rep(i,0,n/2){
		if(s[i] != s[n/2+i]) cnt++;
	}
	
	cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: 'n' was not declared in this scope
   31 |         rep(i,0,n/2){
      |                 ^
a.cc:8:37: note: in definition of macro 'rep'
    8 | #define rep(i,a,n) for(ll i = a;i < n;i++)
      |                                     ^
Language: C++

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

    char S[110];
    char T[110];



    int main()
    {
        string str;
        std::cin >> str;
        int num = str.size();
        int cnt = 0;
        for (int i = 0; i < num; ++i)
        {
            if (str[i]! = str[num -  (i - 1)])
            {
                cnt++;
               
            }
        }
        std::cout << cnt << "\n";
        return 0;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: expected ')' before '!' token
   18 |             if (str[i]! = str[num -  (i - 1)])
      |                ~      ^
      |                       )
Language: C++

#include <iostream>
using namespace std;

int main()
{
	
	char S[101];

	cin >> S;

	int n = strlen(S);

	int count = 0;

	for (int i = 0; i < n; i++)
	{
		if (S[i] != S[n-1-i])
		{
			count++;
		}

	}

	cout << count / 2;

}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int ans=0;
  string s;
  cin>>s;
  int len=s.length();
  int middle=len/2;
  for(int i = 0;i<=middle;i++)
    if(s.at(i)!=s.at(len-1-i);
       ans++;
  
  
  
  
  
  printf("%d\n",ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: expected ')' before ';' token
   12 |        ans++;
      |             ^
      |             )
a.cc:11:7: note: to match this '('
   11 |     if(s.at(i)!=s.at(len-1-i);
      |       ^
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
#include <functional>

#define rep(i,n) for (int i = 0; i< (n); i++)
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: 'retur' was not declared in this scope
   21 |   retur
      |   ^~~~~
a.cc:21:8: error: expected '}' at end of input
   21 |   retur
      |        ^
a.cc:8:12: note: to match this '{'
    8 | int main() {
      |            ^
Language: C++

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


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits.stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string s;
      |   ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>s;
      |   ^~~
a.cc:6:8: error: 's' was not declared in this scope
    6 |   cin>>s;
      |        ^
a.cc:13:15: error: expected ';' before '}' token
   13 |        count++
      |               ^
      |               ;
   14 |      }
      |      ~         
a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   16 |   cout<<count<<endl;
      |   ^~~~
      |   count
a.cc:16:16: error: 'endl' was not declared in this scope
   16 |   cout<<count<<endl;
      |                ^~~~
Language: C++

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

int main()
{
    char a[120];
    ll i,j,k,n,l,c=0;
    gets(a);
    l=strlen(a);
    for(i=0;i<l/2;i++)
    {
       if(a[i]!=a[l-(i+1)]) c++;
    }
     printf("%lld\n",c);
  return 0;
}


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

#include<bits/stdc++.h>
using namspace std;
typedef long long int ll;
int main(){
	string s;
  cin>>s;
  ll r;
  ll ans = 0;
  for(int i = 0 ; i<s.length();i++){
  	r = (s.length()-i-1);
    if(i>=r)break;
    if(s[i] != s[r])ans++;
  }
  cout<<ans<<"\n";
  

}



Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namspace'
    2 | using namspace std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope
    5 |         string s;
      |         ^~~~~~
a.cc:5:9: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 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/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>s;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:8: error: 's' was not declared in this scope
    6 |   cin>>s;
      |        ^
a.cc:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   cout<<ans<<"\n";
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

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

//Atcoder ABC147 B

import java.util.Scanner;

public class Main {

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

		char S[] = sc.next().toCharArray();
		int length = S.length;
		int cnt = 0;

		for(int i=0;i<length;i++) {
			if(S[i]!=S[length-i-1]) {
				cnt++;
			}
          	S[i] = [length-i-1];
		}
		System.out.println(cnt);
	}

}


Compiler output:
Main.java:18: error: illegal start of expression
          	S[i] = [length-i-1];
          	       ^
Main.java:18: error: not a statement
          	S[i] = [length-i-1];
          	                ^
Main.java:18: error: ';' expected
          	S[i] = [length-i-1];
          	                  ^
3 errors
Language: Java

//Atcoder ABC147 B

import java.util.Scanner;

public class Main {

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

		char S[] = sc.next().toChars();
		int length = S.length;
		char c =' ';
		char d =' ';
		int cnt = 0;

		for(int i=0;i<length/2;i++) {
			c = S[i];
			d = S[length-i-1];
			if(c!=d) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}

}


Compiler output:
Main.java:10: error: cannot find symbol
		char S[] = sc.next().toChars();
		                    ^
  symbol:   method toChars()
  location: class String
1 error
Language: Java

//Atcoder ABC147 B

import java.util.Scanner;

public class Main {

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

		char S[] = sc.next().toArray();
		int length = S.length;
		char c =' ';
		char d =' ';
		int cnt = 0;

		for(int i=0;i<length/2;i++) {
			c = S[i];
			d = S[length-i-1];
			if(c!=d) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}

}


Compiler output:
Main.java:10: error: cannot find symbol
		char S[] = sc.next().toArray();
		                    ^
  symbol:   method toArray()
  location: class String
1 error
Language: Java

//Atcoder ABC147 B

import java.util.Scanner;

public class Main {

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

		char S[] = sc.next().toArray();
		int length = S.length();
		char c =' ';
		char d =' ';
		int cnt = 0;

		for(int i=0;i<length/2;i++) {
			c = S[i];
			d = S[length-i-1];
			if(c!=d) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}

}


Compiler output:
Main.java:10: error: cannot find symbol
		char S[] = sc.next().toArray();
		                    ^
  symbol:   method toArray()
  location: class String
Main.java:11: error: cannot find symbol
		int length = S.length();
		              ^
  symbol:   method length()
  location: variable S of type char[]
2 errors
Language: C

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

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

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

int main ()

{
   char *s;
   int i, j, hugs;

   gets(s);

   char s1[strlen(s)];

   for (i=0, j=strlen(s)-1; i<strlen(s);i++, j--)
   {
      s[i] = s1[j];
   }

   if (s[i] == s1[j])
   {
       printf ("0");
       return 0;
   }

   for(i=0, hugs=0; i<strlen(s); i++)
   {
       if (s[i] == s1[i])
        hugs++;
   }

   cout << hugs <<endl;

   return 0;

}


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

#include <bits/stdc++.h>
#include <string.h>

using namespace std;

int main ()

{
   char *s;
   int i, j, hugs;

   gets(s);

   char s1[strlen(s)];

   for (i=0, j=strlen(s)-1; i<strlen(s);i++, j--)
   {
      s[i] = s1[j];
   }

   if (s[i] == s1[j])
   {
       printf ("0");
       return 0;
   }

   for(i=0, hugs=0; i<strlen(s); i++)
   {
       if (s[i] == s1[i])
        hugs++;
   }

   cout << hugs <<endl;

   return 0;

}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<stdio.h>
int main()
{
    char s[200];

    scanf("%s",s);

    int len=0;

    for(int i=0; s[i]!=0;i++)
    len++;

    int count=0;
    for(int i=0,j=(len-1);i<=j;i++,j--)
    {
        if(s[i]!=s[j])
        count++;
    }

    printf("%d",count);
    return 0;
}
#include<stdio.h>
int main()
{
    char s[200];

    scanf("%s",s);

    int len=0;

    for(int i=0; s[i]!=0;i++)
    len++;

    int count=0;
    for(int i=0,j=(len-1);i<=j;i++,j--)
    {
        if(s[i]!=s[j])
        count++;
    }

    printf("%d",count);
    return 0;
}
#include<stdio.h>
int main()
{
    char s[200];

    scanf("%s",s);

    int len=0;

    for(int i=0; s[i]!=0;i++)
    len++;

    int count=0;
    for(int i=0,j=(len-1);i<=j;i++,j--)
    {
        if(s[i]!=s[j])
        count++;
    }

    printf("%d",count);
    return 0;
}


Compiler output:
a.cc:24:5: error: redefinition of 'int main()'
   24 | int main()
      |     ^~~~
a.cc:2:5: note: 'int main()' previously defined here
    2 | int main()
      |     ^~~~
a.cc:46:5: error: redefinition of 'int main()'
   46 | int main()
      |     ^~~~
a.cc:2:5: note: 'int main()' previously defined here
    2 | int main()
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
int main()
{
  char s[101],str[101];
  int num=0,i=0,j,lenth=0;
  gets(s);
  while(s[i]!='\0')
  {
  i++;
  lenth++;
  }
  for(i=lenth-1,j=0;i>=j;i--,j++)
  {

  if(s[i]!=s[j])
  {
  num++;
  }

  }
 printf("%d",num);
   return 0;
}


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

#include<bits/stdc++.h>

int main()
{
    char a[105],p[105];
    scanf("%s",a);
    int i,l,f,j=1;
    l=strlen(a);

    strcpy(p,a);

    if(strcmp(a,strrev(p))==0) printf("0");
    else
    {
        i=0,f=l;
        while(strcmp(a,strrev(p))==0)
            {
                if(a[i]!=a[f-1])
                {
                    j+=1;
                    a[i]=a[f-1];
                    strrev(p);
                    i++,f--;
                }

            }

        printf("%d",j);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
   12 |     if(strcmp(a,strrev(p))==0) printf("0");
      |                 ^~~~~~
      |                 strsep
Language: C++

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

int main()
{
    char a[105],p[105];
    scanf("%s",a);
    int i,l,f,j=1;
    l=strlen(a);

    strcpy(p,a);

    if(strcmp(a,strrev(p))==0) printf("0");
    else
    {
        i=0,f=l;
        while(strcmp(a,strrev(p))==0)
            {
                if(a[i]!=a[f-1])
                {
                    j+=1;
                    a[i]=a[f-1];
                    strrev(p);
                    i++,f--;
                }

            }

        printf("%d",j);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
   13 |     if(strcmp(a,strrev(p))==0) printf("0");
      |                 ^~~~~~
      |                 strsep
Language: C

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

int main()
{
    char a[105],p[105];
    scanf("%s",a);
    int i,l,f,j=1;
    l=strlen(a);

    strcpy(p,a);

    if(strcmp(a,strrev(p))==0) printf("0");
    else
    {
        i=0,f=l;
        while(strcmp(a,strrev(p))==0)
            {
                if(a[i]!=a[f-1])
                {
                    j+=1;
                    a[i]=a[f-1];
                    strrev(p);
                    i++,f--;
                }

            }

        printf("%d",j);
    }
}


Compiler output:
main.c: In function 'main':
main.c:13:17: error: implicit declaration of function 'strrev'; did you mean 'strsep'? [-Wimplicit-function-declaration]
   13 |     if(strcmp(a,strrev(p))==0) printf("0");
      |                 ^~~~~~
      |                 strsep
main.c:13:17: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   13 |     if(strcmp(a,strrev(p))==0) printf("0");
      |                 ^~~~~~~~~
      |                 |
      |                 int
In file included from main.c:2:
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
main.c:17:24: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   17 |         while(strcmp(a,strrev(p))==0)
      |                        ^~~~~~~~~
      |                        |
      |                        int
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    char *s;
    int n, i, count = 0;
    gets(s);
    n = strlen(s);
    for(i=0; i<n/2; i++){
        if(s[i] != s[n-i-1]){
            count++;
        }
    }
    printf("%d", count);
    return 0;
}


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

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


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-i-1])ans++;}
    cout<<ans;
    }
   

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: expected ';' before 's'
    7 |     cin s;
      |        ^~
      |        ;
a.cc:9:14: error: expected ',' or ';' before ':' token
    9 |     int ans=0:
      |              ^
a.cc:10:23: error: 'i' was not declared in this scope
   10 |     for(int i=0:i<n/2;i++){
      |                       ^
Language: C++

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


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-i-1])ans++;}
    cout<<ans;
    }

Compiler output:
a.cc:1:9: fatal error: bits/stdc.h: No such file or directory
    1 | #include<bits/stdc.h>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected primary-expression before ';' token
    8 |     int n=s.size(;
      |                  ^
a.cc:11:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |         ans++;
      |         ^~~
      |         abs
a.cc:13:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |     cout<<ans;
      |           ^~~
      |           abs
Language: C++

#include<iostream>
using namespace std;
int main(){
	string s;
  cin>>s;
  int n=s.length();
  int cnt=0;
  rep(i,0,n){
  	if(s[i]!=s[n-i-1])cnt++;
  }
       cout<<cnt<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   rep(i,0,n){
      |       ^
a.cc:8:3: error: 'rep' was not declared in this scope
    8 |   rep(i,0,n){
      |   ^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'n' was not declared in this scope
    5 | string s[n];
      |          ^
a.cc:10:6: error: 's' was not declared in this scope
   10 |   if(s[i] != s[n-1-i]) res++;
      |      ^
a.cc:10:24: error: 'res' was not declared in this scope
   10 |   if(s[i] != s[n-1-i]) res++;
      |                        ^~~
a.cc:12:9: error: 'res' was not declared in this scope
   12 |   cout<<res/2;
      |         ^~~
Language: C++

 #include <stdio.h>
 #include <string.h>
 int main(void) {
   string s[101];
   cin>>s;
 int res = 0;
 int n = s.lenght();
 for (int i = 0; i < n; i++) {
  if (s[i] != s[n - 1 - i]) res++;
 }
 cout<<res/2;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:4:4: error: 'string' was not declared in this scope; did you mean 'stdin'?
    4 |    string s[101];
      |    ^~~~~~
      |    stdin
a.cc:5:4: error: 'cin' was not declared in this scope
    5 |    cin>>s;
      |    ^~~
a.cc:5:9: error: 's' was not declared in this scope
    5 |    cin>>s;
      |         ^
a.cc:11:2: error: 'cout' was not declared in this scope
   11 |  cout<<res/2;
      |  ^~~~
Language: C++

 #include <stdio.h>
 #include <string.h>
 char s[101];
 int main(void) {
 string s;
   cin>>s;
 int res = 0;
 int n = s.lenght();
 for (int i = 0; i < n; i++) {
  if (s[i] != s[n - 1 - i]) res++;
 }
 cout<<res/2;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:5:2: error: 'string' was not declared in this scope; did you mean 'stdin'?
    5 |  string s;
      |  ^~~~~~
      |  stdin
a.cc:6:4: error: 'cin' was not declared in this scope
    6 |    cin>>s;
      |    ^~~
a.cc:8:12: error: request for member 'lenght' in 's', which is of non-class type 'char [101]'
    8 |  int n = s.lenght();
      |            ^~~~~~
a.cc:12:2: error: 'cout' was not declared in this scope
   12 |  cout<<res/2;
      |  ^~~~
Language: C++

#include<iostream>
using namespace std;
int count_reduces(string& str){
int n=str.length();
  int res=0;
  for(int i=0;i<n/2;i++){
  res +=abs(str[i]-str[n-i-1];
  }
            return 0;
}
            int main(){
            	string str;
              cin>>str;
              cout<< count_reduces(str);
            }

Compiler output:
a.cc: In function 'int count_reduces(std::string&)':
a.cc:7:30: error: expected ')' before ';' token
    7 |   res +=abs(str[i]-str[n-i-1];
      |            ~                 ^
      |                              )
Language: C++

#include<bits/stdc++.h>
#include<String>

using namespace std;

int main(){
   
   int c=0;
  string S;
  getline(cin, S); 
  int n=S.length();
  for(int i=0;i<n/2;i++){
      if(S[i]!=S[n-i-1]){
          c++;
      }
  }
   
   cout<<c;


}

Compiler output:
a.cc:2:9: fatal error: String: No such file or directory
    2 | #include<String>
      |         ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <String>
using namespace std;

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


Compiler output:
a.cc:4:10: fatal error: String: No such file or directory
    4 | #include <String>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <String>
using namespace std;

int main()
{
   string name;
   int i,c=0,j;
   cin>>name;
   for(i=0,j=name.length()-1;i<name.length()/2;i++,j--){
    if(name[i]!=name[j]){
        c++;
    }
   }
   printf("%d",c);
    return 0;
}


Compiler output:
a.cc:4:10: fatal error: String: No such file or directory
    4 | #include <String>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <string>

using ll = long long int;
using namespace std;

#define FOR(i,N) for(int i=0;i<N;i++)
#define pb(x) push_back(x)

int main() {
    string s, t;
    cin >> s;
    t = s;
    reverse(s.begin(), s.end());
    int cnt = 0;
    for (int i = 0; i < s.size() / 2; i++) {
        if (s[i] != t[i])cnt++;
    }

    cout << cnt;
    return 0;
}

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

#include<bits/stdc++.h>
#define pi 3.14159
using namespace std;
typedef long long LL;
const LL MOD = 1e9 + 7;
const int N = 2e7 + 9, M = 1e7, OO = 0x3f3f3f3f;
int main()
{
int main()
{
    string s;
    cin >> s;
    int len = s.size(), ans = 0;
    for(int i=0;i<len/2;i++) {
        if(s[i] != s[len-i-1]) ans++;
    }
    cout << ans << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    9 | int main()
      |         ^~
a.cc:9:9: note: remove parentheses to default-initialize a variable
    9 | int main()
      |         ^~
      |         --
a.cc:9:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:10:1: error: a function-definition is not allowed here before '{' token
   10 | {
      | ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: Java

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


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

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


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

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


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

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

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

#include <iostream>
#include <string.h>
#include "knownalgo.hpp"

using namespace std;

int main(){
	char S[100];
	int  i,j,len,count=0;

	cin>>S;

	len=strlen(S);
	len--;

	for(i=0;i<=len/2;i++){
		if(S[i]!=S[len-i]) count++;
	}

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


Compiler output:
a.cc:3:10: fatal error: knownalgo.hpp: No such file or directory
    3 | #include "knownalgo.hpp"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string.h>
#include </home/ei1812/lib/knownalgo.hpp>

using namespace std;

int main(){
	char S[100];
	int  i,j,len,count=0;

	cin>>S;

	len=strlen(S);
	len--;

	for(i=0;i<=len/2;i++){
		if(S[i]!=S[len-i]) count++;
	}

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


Compiler output:
a.cc:3:10: fatal error: /home/ei1812/lib/knownalgo.hpp: No such file or directory
    3 | #include </home/ei1812/lib/knownalgo.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main() {
  string s;
  int error;
  getline(cin, s);
  for(int i = 0; i < s.length()/2; i++) {
    if(s[i] != s[s.length-i]) {
      error++;
    }
  }
  cout << error;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: 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 '()' ?)
   10 |     if(s[i] != s[s.length-i]) {
      |                  ~~^~~~~~
      |                          ()
Language: Java

import java.util.*;
public class test {
 
 
 
    /**
     * @param args
     */
    public static void main(final String[] args) {
 
 
 		Scanner sc = new Scanner(System.in);
 		final String aStr = sc.next();;
 
        /** 不一致件数カウント */
        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

import java.util.*;
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:2: error: class test is public, should be declared in a file named test.java
public class test {
       ^
Main.java:22: error: cannot find symbol
        while (aI * 2 < aStr.length()) {
                            ^
  symbol:   method length()
  location: variable aStr of type Scanner
Main.java:26: error: cannot find symbol
            if (aStr.charAt(aI) == aStr.charAt(aStr.length() - aI - 1)) {
                    ^
  symbol:   method charAt(int)
  location: variable aStr of type Scanner
Main.java:26: error: cannot find symbol
            if (aStr.charAt(aI) == aStr.charAt(aStr.length() - aI - 1)) {
                                                   ^
  symbol:   method length()
  location: variable aStr of type Scanner
4 errors