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

#include <stdio.h>
2. 
3.int main(void)
4.{
5.  int x[20];
6.  int i = 0;
7.  int max = 0;
8.  int sum = 0;
9.  int n = 0;
10.  scanf("%d", &n);
11.  while(i < n){
12.    scanf("%d", &x[i]);
13.    i++;
14.  }
15.  i = 0;
16.  while(i < n){
17.    if(max <= x[i]){
18.      max = x[i];
19.      sum++;
20.    }
21.    i++;
22.  }
23.  
24.  printf("%d", sum);
25.  return(0);
26.}


Compiler output:
main.c:2:1: error: expected identifier or '(' before numeric constant
    2 | 2.
      | ^~
main.c:3:1: error: invalid suffix "int" on floating constant
    3 | 3.int main(void)
      | ^~~~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back

using namespace std;
const long long MOD = (long long)1e9 + 7;

int n, h, cur;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> h;
        if (h >= cur) {
            ans++;
            cur = h;
        }
    }
    cout << ans << "\n";
    //system("pause");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |             ans++;
      |             ^~~
      |             abs
a.cc:23:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |     cout << ans << "\n";
      |             ^~~
      |             abs
Language: C++

#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <queue>
#include <algorithm>
#include <functional>
#include <string>
#include <bitset>

#define ll long long
#define fri(n) for(i=0;i<(n);i++)
#define frj(n) for(j=0;j<(n);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define INF 1000000000000000000//10^18
#define INFINT 2000000001//2*10^9+1
#define MOD 1000000007
#define MODANOTHER 998244353
#define PI acos(-1)

using namespace std;


int main(void)
{
	//変数の宣言
	int n;
	int h[30];

	//よく使う変数
	int i,j,l;
	int flag=0;
	int ans=0;
	int count=0;
	int temp=0;
	int temp1=0;
	int temp2=0;
	int max=0;
	int min=INFINT;
	int len=0;
	int sum=0;
	int ok=0;
	int ng=0;
	int dummy;



	//データの読み込み


//	scanf("%d",&n);
	scanf_s("%d",&n);



	for(i=0;i<n;i++){
//		scanf(%d",&h[i]);
		scanf_s("%d",&h[i]);
	}

	//	printf("nは%dです\n", n);
	//	printf("データの読み込み終了\n");
	//実際の処理

	temp=0;
	for(i=0;i<n;i++){
		temp=max(temp,h[i]);
		if(temp<=h[i]){
			ans++;
		}
	}


	//	printf("計算部分終了\n");

	//出力
	printf("%d",ans);

	//	printf("結果の出力終了\n");

	return 0;
}



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

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

int main() {
  int N, i, count = 0, maxh = 0;
  cin >> N;
  
  vector<int> H(N);
  for(i = 0; i < N; i++){
    cin >> H.at(i);
  }
  
  for(i = 0; i < N; i++){
    if(H.at(i) >= maxh){
      maxh = H.at(i);
      count++
    }
  }
  
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: expected ';' before '}' token
   16 |       count++
      |              ^
      |              ;
   17 |     }
      |     ~
Language: C++

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

int main(void){
    int N,max=0,cnt=0;
    cin>>N;
    int H[N];
    for(int i=0;i<N;i++){
        cin>>H[i];
        if(H[i]>max){
            max=H[i];
            cnt++;
        }else
            break;
    }
    cout<<cnt<<endl;
    return 0;
}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'naemespcae'
    2 | using naemespcae std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     cin>>N;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |     cout<<cnt<<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:16:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |     cout<<cnt<<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

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

#define REP(i,n) for(i=0;i<n;i++)

int iin() {
    int i;
    scanf("%d", &i);
    return i;
}

long long llin() {
    long long i;
    scanf("%lld", &i);
    return i;
}

double din() {
    double i;
    scanf("%lf", &i);
    return i;
}

char cin() {
    char c;
    scanf("%c", &c);
    return c;
}

void stin(char *s) {
    scanf("%s", s);
}

void iout(int i) {
    printf("%d\n", i);
}

void llout(long long i) {
    printf("%lld\n", i);
}

void dout(double i) {
    printf("%lf\n", i);
}

void cout(char c) {
    printf("%c\n", c);
}

void stout(char *s) {
    printf("%s\n", s);
}

int main() {
    int N = iin();
    int H, max = 0, count = 0, i;
    REP(i,N) {
        H = iin();
        if (max =< H) {
            count++;
            max = H;
        }
        iout(count);
    }
    iout(count);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:62:18: error: expected expression before '<' token
   62 |         if (max =< H) {
      |                  ^
Language: C++

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

int main(){
    //入力
    int n;
    cin >> n;
    vector<int>yama(n);
    for(int i=0;i<n;i++)
    {
        cin >> yama[i];
    }

    //処理
    int ans=1;
    int max_=yama[i];
    for(int i=1;i<n;i++)
    {
        if(max_<yama[i])
        {
            ans++;
            max_=yama[i];
        }
    }

    //出力
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: 'i' was not declared in this scope
   16 |     int max_=yama[i];
      |                   ^
Language: C++

#include <iostream>

int main()
{
  int H[100];
  int N;
  std::cin >> N;
  for (int x = 0; x < N; ++x)
    std::cin >> H[x];

  int z = 1;
  for (int x = 1; x < N; ++x)
  {
    if (H[x - 1] <= H[x])
    {
      z++;
    }
  }
  std::cout << Z << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: 'Z' was not declared in this scope
   19 |   std::cout << Z << std::endl;
      |                ^
Language: C

#include <stdio.h>
int main(){
  int n,h[20],res=1,flag=1;
  scanf("%d",&n);
  for (int i=0;i<n;i++) scanf("%d",&h[i]);
  for (int i=1;i<n;i++){
    for (int j=1;j<i;j++){
      if (h[j]>h[i]){
        flag=0;
        break;
      }
    }
    if (flag) res++;
  }
  printf("%d\n",res);
  return 0;

Compiler output:
main.c: In function 'main':
main.c:16:3: error: expected declaration or statement at end of input
   16 |   return 0;
      |   ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#include <bits/stdc++.h>
#include <utility>
#include <iomanip>

#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,a,b) for(int i = (a); (b) <= i; i--)
#define REP(i,n) for(int i = 0; i < (n); i++)
#define RREP(i,n) for(int i = n; n <= i; i--)
#define ABS(a) ((a < 0) ? ((-1)*(a)) : (a))
#define elif else if
#define MOD 1000000007
#define INF (1<<30)

using namespace std;

#define ld long double
#define ll long long

map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  int H[N+10];
  h[0]=0;
  for(int i=1;i<=N;i++){
    cin >> H[i];
  }
  int ans=0;
  for(int i=1;i<=N;i++){
    bool flag =true;
    for(int j=0;j<i;j++){
      if(H[j]>H[i]){
        flag=false;
        break;
      }
    }
    if(falg){
      ans++;
    }
  }

  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:3: error: 'h' was not declared in this scope
   44 |   h[0]=0;
      |   ^
a.cc:57:8: error: 'falg' was not declared in this scope; did you mean 'flag'?
   57 |     if(falg){
      |        ^~~~
      |        flag
Language: C

n = int(input())
H = list(map(int, input().split()))

ans = 1
for i in range(1,n):
    if max(H[:i]) <= H[i]:
        ans += 1

print(ans)


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n = int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:5: error: expected expression before 'int'
    1 | n = int(input())
      |     ^~~
Language: C++

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

int N;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	cin >> N;

	vector<int> H<N>;

	for(auto &x: H) cin >> x;

	int ans;
	int top = H[0];
	REP(i,N - 1){
		if(H[i + 1] > top){
			break;
		}
		ans++;
	}
	cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: expected initializer before '<' token
   14 |         vector<int> H<N>;
      |                      ^
a.cc:16:22: error: 'H' was not declared in this scope
   16 |         for(auto &x: H) cin >> x;
      |                      ^
a.cc:19:19: error: 'H' was not declared in this scope
   19 |         int top = H[0];
      |                   ^
Language: C++

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<vector>
#include<deque>
#include<queue>

using std::cout;
using std::cin;
using std::setw;
using std::setfill;
using std::string;
using std::pair;
using std::make_pair;
using std::vector;
using std::queue;
using std::deque;
using std::priority_queue;
using std::next_permutation;
//using std::iota;
using std::sort;
using std::greater;
using std::max;
using std::min;

using lli = long long int;
using ulli = unsigned long long int;

#define INF 999999999;

#define EVEL 1

#ifndef EVEL
#define dbug(X) std::cout << #X << ":" <<X<<" " ;
#define dbugf(s) std::cout << s << " ";
#define dbugln std::cout<<"\n";
#else
#define dbug(X) {}
#define dbugf(s) {}
#define dbugln {}
#endif

lli N, H[100];
lli max=0;
lli ans = 0;

int main(void){
	cin.tie(0);
	std::ios::sync_with_stdio(false);

	cin >> A;
	for(int i = 0; i < N; i++){
		cin >> H[i];
		if(H[i] > max){
			max = H[i];
			ans++;
		}
	}
	cout << ans;

	return 0;
}


Compiler output:
a.cc:45:5: error: 'lli max' conflicts with a previous declaration
   45 | lli max=0;
      |     ^~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: previous declaration 'namespace std { }::max'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc: In function 'int main()':
a.cc:52:16: error: 'A' was not declared in this scope
   52 |         cin >> A;
      |                ^
a.cc:55:25: error: invalid operands of types 'lli' {aka 'long long int'} and '<unresolved overloaded function type>' to binary 'operator>'
   55 |                 if(H[i] > max){
      |                    ~~~~~^~~~~
a.cc:56:34: error: overloaded function with no contextual type information
   56 |                         max = H[i];
      |                                  ^
Language: C++

#include <cstdio>
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;

int main()
{
	int n;
  	cin >> nl
	vector<int> h(n);
	int ans = 1;
	for (int i = 0; i < n; i++) {
		cin >> h[i];
	}
	for (int i = 0; i < n; i++) {
		if (h[i] < h[i + 1]) ans++;
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'nl' was not declared in this scope; did you mean 'n'?
   13 |         cin >> nl
      |                ^~
      |                n
a.cc:17:24: error: 'h' was not declared in this scope
   17 |                 cin >> h[i];
      |                        ^
a.cc:20:21: error: 'h' was not declared in this scope
   20 |                 if (h[i] < h[i + 1]) ans++;
      |                     ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define vi vector<int>
#define fi first
#define se second 
#define mp make_pair
#define show(x) cout<<#x<<" = "<<x<<endl;
typedef unsigned long long ull;
typedef pair<int,int> P;
#define LL long long 
#define pi acos(-1)
#define fin freopen("in","r",stdin);
const int inf=0x3f3f3f3f;
const double eps=1e-8;
#define zero(x) (((x)>0?(x):-(x))<eps)
#define _sign(x) ((x)>eps?1:((x)<-eps?2:0))
typedef long long ll;
const int maxn = 1000005, mod = 1e9+7;
#define fin freopen("in","r",stdin);
string s[101];
int n;
vector<int> v(maxn,1);
vector<ll> p;
int a[maxn],n;
int main(){
	int mx=0,ans=0;
	cin>>n;
	for(int i=0;i<n;i++) {
		cin>>a[i];
		if(a[i]>=mx){
			mx=a[i];
			ans++;
		}
	}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc:25:13: error: redefinition of 'int n'
   25 | int a[maxn],n;
      |             ^
a.cc:22:5: note: 'int n' previously declared here
   22 | int n;
      |     ^
Language: C++

/*#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <array>
#include <vector>
#include <deque>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
*/

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

#define int long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define SORT(c) sort((c).begin(),(c).end())

typedef long long ll;
const ll INF = 1LL<<60;
const ll mod = 1e9 + 7;
const int MAX_N = 5e5 + 5;
int dx[] = { -1,0,1,0 }, dy[] = { 0,1,0,-1 };
vector<ll> prime;

ll inv[MAX_N], fac[MAX_N];

template <class T = ll> T in() { T x; cin >> x; return (x); }
inline ll GCD(ll a, ll b) { ll c; while (b != 0) { c = a % b; a = b; b = c; }return a; }
inline ll LCM(ll a, ll b) { return a * b / GCD(a, b); }
inline ll POW(ll a, ll b) { ll c = 1; while (b > 0) { if (b & 1) { c = a * c%mod; }a = a * a%mod; b >>= 1LL; }return c; }
inline void _nCr() { fac[0] = 1; for (int i = 1LL; i < MAX_N; i++) { fac[i] = fac[i - 1] * i%mod; }for (int i = 0; i < MAX_N; i++) { inv[i] = POW(fac[i], mod - 2); } }
inline ll nCr(ll n, ll r) { return (fac[n] * inv[r] % mod)*inv[n - r] % mod; }
inline void PRI(ll n) { bool a[n + 1]; for (int i = 0; i < n + 1; i++) { a[i] = 1; }for (int i = 2; i < n + 1; i++) { if (a[i]) { prime.pb(i); ll b = i; while (b <= n) { a[b] = 0; b += i; } } } }

typedef pair<int, pair<int, int>> edge;


signed main() {
	int n;
	cin >> n;
	int h[n];
	REP (i,n) cin >> h[i];
	int ans = 1;
	int ma = h[0];
	FOR (i,1,n) {if (h[i] > max) ans++;ma = max(ma,h[i]);}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:31: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator>'
   58 |         FOR (i,1,n) {if (h[i] > max) ans++;ma = max(ma,h[i]);}
      |                          ~~~~~^~~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <string>
#include <cmath>
#include <complex>
#include <numeric>
#include <cassert>

#include <vector>
#include <array>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <utility>

#define int64 long long
#define uint64 unsigned long long
#define PI 3.1415926535897932384626433832795
#define coutfix(i) cout << fixed << setprecision(i)
using namespace std;

int main()
{
	string ss;
	cin >> ss;
	int64 aa = 0;
	for(int64 ii = 0;ii < ss.length();ii++)
	{
		if((ss[ii] - '0') == ii % 2)
		{
			aa++;
		}
	}
	cout << min(aa, ss.length() - aa) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:20: error: no matching function for call to 'min(long long int&, long long unsigned int)'
   38 |         cout << min(aa, ss.length() - aa) << endl;
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:38:20: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   38 |         cout << min(aa, ss.length() - aa) << endl;
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:38:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   38 |         cout << min(aa, ss.length() - aa) << endl;
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  long long N=S.size();
  long long zero_even=0,zero_odd=0;
  for(int i=0;i<N;i++){
    if(i%2==0 && S.at(i)=='0){
      zero_even++;
    }
    else if(i%2==1 && S.at(i)=='0){
      zero_odd++;
    }
  }
  long long a_1,a_2;
  a_1=(N+1)/2-zero_even+zero_odd;//010...
  a_2=zero_even+N/2-zero_odd;//101...
  cout<<min(a_1,a_2)<<endl;
}


Compiler output:
a.cc:9:27: warning: missing terminating ' character
    9 |     if(i%2==0 && S.at(i)=='0){
      |                           ^
a.cc:9:27: error: missing terminating ' character
    9 |     if(i%2==0 && S.at(i)=='0){
      |                           ^~~~
a.cc:12:32: warning: missing terminating ' character
   12 |     else if(i%2==1 && S.at(i)=='0){
      |                                ^
a.cc:12:32: error: missing terminating ' character
   12 |     else if(i%2==1 && S.at(i)=='0){
      |                                ^~~~
a.cc: In function 'int main()':
a.cc:11:5: error: expected primary-expression before '}' token
   11 |     }
      |     ^
a.cc:10:19: error: expected ')' before '}' token
   10 |       zero_even++;
      |                   ^
      |                   )
   11 |     }
      |     ~              
a.cc:9:7: note: to match this '('
    9 |     if(i%2==0 && S.at(i)=='0){
      |       ^
a.cc:11:5: error: expected primary-expression before '}' token
   11 |     }
      |     ^
a.cc:12:5: error: 'else' without a previous 'if'
   12 |     else if(i%2==1 && S.at(i)=='0){
      |     ^~~~
a.cc:12:13: error: 'i' was not declared in this scope
   12 |     else if(i%2==1 && S.at(i)=='0){
      |             ^
a.cc:14:5: error: expected primary-expression before '}' token
   14 |     }
      |     ^
a.cc:13:18: error: expected ')' before '}' token
   13 |       zero_odd++;
      |                  ^
      |                  )
   14 |     }
      |     ~             
a.cc:12:12: note: to match this '('
   12 |     else if(i%2==1 && S.at(i)=='0){
      |            ^
a.cc:14:5: error: expected primary-expression before '}' token
   14 |     }
      |     ^
a.cc: At global scope:
a.cc:15:3: error: expected declaration before '}' token
   15 |   }
      |   ^
a.cc:17:3: error: 'a_1' does not name a type
   17 |   a_1=(N+1)/2-zero_even+zero_odd;//010...
      |   ^~~
a.cc:18:3: error: 'a_2' does not name a type
   18 |   a_2=zero_even+N/2-zero_odd;//101...
      |   ^~~
a.cc:19:3: error: 'cout' does not name a type
   19 |   cout<<min(a_1,a_2)<<endl;
      |   ^~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

#include<bots/stdc++.h>

#define Vsort(a) sort(a.begin(), a.end())
#define Vreverse(a) reverse(a.bigin(), a.end())
#define rep(i,n) for(int i = 0; i < (n); i++)
#define Srep(i,a,n) for(int i = (a); i < (n); i++)
#define vi vector<int>
#define vi64 vector<int64_t>
#define vvi vector<vector<int>>
#define vvi64 vector<vector<int64_t>>

using namespace std;

int main(){
    string s;
    int zero = 0, one = 0;
    cin >> s;
    int n = s.size();
    vector<char> ZERO(n), ONE(n);
    rep(i,n) ZERO[i] = s.at(i);
    rep(i,n) ONE[i] = s.at(i);
    if(ZERO[0] == '1'){
        zero++;
        ZERO[0] = '0';
    }
    if(ONE[0] == '0'){
        one++;
        ONE[0] = '1';
    }
    Srep(i,1,n){
        if(ZERO[i-1] == ZERO[i]) {
            ZERO[i-1] == '0' ? ZERO[i] = '1' : ZERO[i] = '0';
            zero++;
        }
        if(ONE[i-1] == ONE[i]) {
            ONE[i-1] == '0' ? ONE[i] = '1' : ONE[i] = '0';
            one++;
        }
    }
    cout << zero << one << endl;
    zero < one ? cout << zero << endl : cout << one << endl;
}

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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>

int main() {
	std::string s; std::cin >> s;
	int A, B;
	if (s.size() % 2 == 0) {
		std::string p = "";
		std::string pp = "";
		for (int i = 0; i < s.size() / 2; ++i) {
			p.push_back('1');
			p.push_back('0');
			pp.push_back('0');
			pp.push_back('1');
		}
		int a = 0; int b = 0;
		for (int i = 0; i < s.size(); ++i) {
			if (p[i] != s[i]) ++a;
			if (pp[i] != s[i]) ++b;
		}
		A = std::min(a, b);
	}
	else {
		std::string p = "1";
		std::string pp = "0";
		std::string pp = "";
		for (int i = 0; i < s.size() - 1 / 2; ++i) {
			p.push_back('0');
			p.push_back('1');
			pp.push_back('1');
			pp.push_back('0');
		}
		int a = 0; int b = 0;
		for (int i = 0; i < s.size(); ++i) {
			if (p[i] != s[i]) ++a;
			if (pp[i] != s[i]) ++b;
		}
		B = std::min(a, b);
	}
	std::cout << std::min(A, B) << std::endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:29: error: redeclaration of 'std::string pp'
   31 |                 std::string pp = "";
      |                             ^~
a.cc:30:29: note: 'std::string pp' previously declared here
   30 |                 std::string pp = "0";
      |                             ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
  cin >> s;
  int i,ans1,ans2;
  ans1=0;
  ans2=0;
  string t1(),t2();
  for(i=0;i<s.size();++i)
  {
  if(i%2==0) {t1.at(i)='0';
              t2.at(i)='1';}
  if(i%2==1) {t1.at(i)='1';
              t2.at(i)='0';}
  }
  
   for(i=0;i<s.size();++i)
  {
  if(t1.at(i)==s.at(i)) ans1++;
  if(t2.at(i)==s.at(i)) ans2++;
  }
  if(ans1>ans2) cout << s.size()-ans1;
  else cout << s.size()-ans2;
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   10 |   string t1(),t2();
      |            ^~
a.cc:10:12: note: remove parentheses to default-initialize a variable
   10 |   string t1(),t2();
      |            ^~
      |            --
a.cc:10:17: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   10 |   string t1(),t2();
      |                 ^~
a.cc:10:17: note: remove parentheses to default-initialize a variable
   10 |   string t1(),t2();
      |                 ^~
      |                 --
a.cc:13:18: error: request for member 'at' in 't1', which is of non-class type 'std::string()' {aka 'std::__cxx11::basic_string<char>()'}
   13 |   if(i%2==0) {t1.at(i)='0';
      |                  ^~
a.cc:14:18: error: request for member 'at' in 't2', which is of non-class type 'std::string()' {aka 'std::__cxx11::basic_string<char>()'}
   14 |               t2.at(i)='1';}
      |                  ^~
a.cc:15:18: error: request for member 'at' in 't1', which is of non-class type 'std::string()' {aka 'std::__cxx11::basic_string<char>()'}
   15 |   if(i%2==1) {t1.at(i)='1';
      |                  ^~
a.cc:16:18: error: request for member 'at' in 't2', which is of non-class type 'std::string()' {aka 'std::__cxx11::basic_string<char>()'}
   16 |               t2.at(i)='0';}
      |                  ^~
a.cc:21:9: error: request for member 'at' in 't1', which is of non-class type 'std::string()' {aka 'std::__cxx11::basic_string<char>()'}
   21 |   if(t1.at(i)==s.at(i)) ans1++;
      |         ^~
a.cc:22:9: error: request for member 'at' in 't2', which is of non-class type 'std::string()' {aka 'std::__cxx11::basic_string<char>()'}
   22 |   if(t2.at(i)==s.at(i)) ans2++;
      |         ^~
Language: C++

#include<stdio.h>
int main()
{
string s;
  cin >> s;
  int i,ans1,ans2;
  string t1,t2;
  for(i=0;i<s.size();++i)
  {
  if(i%2==0) {t1.at(i)='0';
              t2.at(i)='1';}
  if(i%2==1) {t1.at(i)='1';
              t2.at(i)='0';}
  }
  
   for(i=0;i<s.size();++i)
  {
  if(t1.at(i)==s.at(i)) ans1++;
  if(t2.at(i)==s.at(i)) ans2++;
  }
  if(ans1>ans2) cout << s.size()-ans1;
  else cout << s.size()-ans2;
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'string' was not declared in this scope; did you mean 'stdin'?
    4 | string s;
      | ^~~~~~
      | stdin
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> s;
      |   ^~~
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin >> s;
      |          ^
a.cc:7:9: error: expected ';' before 't1'
    7 |   string t1,t2;
      |         ^~~
      |         ;
a.cc:10:15: error: 't1' was not declared in this scope
   10 |   if(i%2==0) {t1.at(i)='0';
      |               ^~
a.cc:11:15: error: 't2' was not declared in this scope
   11 |               t2.at(i)='1';}
      |               ^~
a.cc:12:15: error: 't1' was not declared in this scope
   12 |   if(i%2==1) {t1.at(i)='1';
      |               ^~
a.cc:13:15: error: 't2' was not declared in this scope
   13 |               t2.at(i)='0';}
      |               ^~
a.cc:18:6: error: 't1' was not declared in this scope
   18 |   if(t1.at(i)==s.at(i)) ans1++;
      |      ^~
a.cc:19:6: error: 't2' was not declared in this scope
   19 |   if(t2.at(i)==s.at(i)) ans2++;
      |      ^~
a.cc:21:17: error: 'cout' was not declared in this scope
   21 |   if(ans1>ans2) cout << s.size()-ans1;
      |                 ^~~~
a.cc:22:8: error: 'cout' was not declared in this scope
   22 |   else cout << s.size()-ans2;
      |        ^~~~
Language: C

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

int main(void){
  int i,n,count1=0;
  char s[100005];
  scanf("%s",s);
  n=strlen(s);
  if(n==1){
    printf("0\n");
    return 0;
  }
  if(n==2){
    if((s[0]=='0')&&(s[1]=='0')){
    printf("1\n");
    return 0;
    }
    if((s[0]=='1')&&(s[1]=='1')){
      printf("1\n");
      return 0;
    }
    else { printf("0\n");
      return 0;}
  }

  if((s[0]=='0')&&(s[1]=='0')&&(s[2]=='1')){
    s[0]='0';
    count1++;
  }
  if((s[0]=='1')&&(s[1]=='1')&&(s[2]=='0')){
    s[0]='0';
    count1++;
  }
  for(int i=0;i<=n-3;i++){
    if((s[i]=='0')&&(s[i+1]=='0')&&(s[i+2]=='0')){
      s[i+1]='1';
      count1++;
    }
    if((s[i]=='1')&&(s[i+1]=='1')&&(s[i+2]=='1')){
      s[i+1]='0';
      count1++;
    }
    if((s[i]=='0')&&(s[i+1]=='1')&&(s[i+2]=='1')){
      s[i+2]='0';
      count1++;
    }
    if((s[i]=='1')&&(s[i+1]=='0')&&(s[i+2]=='0')){
      s[i+2]='1';
      count1++;
    }
}
    printf("%d\n",count1)
      return 0;
}        
  

Compiler output:
main.c: In function 'main':
main.c:53:26: error: expected ';' before 'return'
   53 |     printf("%d\n",count1)
      |                          ^
      |                          ;
   54 |       return 0;
      |       ~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
signed main()
{
	ios::sync_with_stdio(0);
    cin.tie(0);
	string s;
	cin>>s;
	int n=s.size();
	int bwbw=0,wbwb=0;
	for(int i=0;i<n;i++){
		if(i%2&&s[i]=='0')bwbw++;
		if(i%2=o=0&&s[i]=='1')bwbw++;
		if(i%2&&s[i]=='1')wbwb++;
		if(i%2==0&&s[i]=='0')wbwb++;
	}
	cout<<min(bwbw,wbwb);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: 'o' was not declared in this scope
   13 |                 if(i%2=o=0&&s[i]=='1')bwbw++;
      |                        ^
Language: C++

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

int main(){
string S;
cin>>S;
int a=S.size();
for(int i=0;i<2;i++){
   int cou=0;
   for(int j=0;j<S.size();j++){
   if(j%2==0&&S[j]!==(char)(i+'0')){
      cou++;
   }
   if(j%2==1&&S[j]==(char)(i+'1')){
      cou++;
   }
   }
   a=min(a,cou);
}
cout<<a<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: expected primary-expression before '=' token
   13 |    if(j%2==0&&S[j]!==(char)(i+'0')){
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define cans cout << ans << endl
#define cyes cout << "Yes" << endl
#define cno cout << "No" << endl
typedef long long ll;


int main(){
    string s;
    cin >> s;
  	int a=0,b=0;
    for(int i=0; i<n; i++){
        if(i%2){
            if(s[i]=='0') a++;
            else b++;
        }
        else{
            if(s[i]=='1') a++;
            else b++;
        }
    }
    cout << min(a,b) << endl;
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define cans cout << ans << endl
#define cyes cout << "Yes" << endl
#define cno cout << "No" << endl
typedef long long ll;


int main(){
    string s;
    cin >> s;
  	int a=0,b=0;
    for(int i=0; i<n; i++){
        if(i%2){
            if(s[i]=='0') a++;
            else b++;
        }
        else{
            if(s[i]='1') a++;
            else b++;
        }
    }
    cout << min(a,b) << endl;
    return 0;
}

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

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

#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384


int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} 
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}    //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}     //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);}       // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}  //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}   //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}  // b進数の各位の和？
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和

//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}

//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}


typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
bool is_prime (int x){
  if (x<=1) return false ;
  for (int i=2 ; i*i<=x ; i++){
    if (x%i==0) return false ;
  }
   return true;
}
string alpha = "abcdefghijklmnopqrstuvwxyz"

 
/*CODE START HERE*/
int main() {
  string s;
  int count = 0;
  forn(i,s.size()-1){
  if ( s.at(i)==s.at(i+1)){
    count ++ ;
    if (s.at(i+1) == '1'){
      s.at(i+1) = '0';
    }else s.at(i+1) = '1' ;
  }
    }
  cout << count << endl;
}

Compiler output:
a.cc:67:1: error: expected ',' or ';' before 'int'
   67 | int main() {
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  int ans=;s.size();
  for(int i=0;i<2;i++){
    int cnt=0;
    for(int j=0;j<s.size();j++){
      if(j%2==0&&s.at(j)!=(char)(i+'0')){
        cnt++;
      }
      if(j%2==1&&s.at(j)==(char)(i+'0')){
        cnt++;
      }
    }
    ans=min(ans,cnt);
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: expected primary-expression before ';' token
    6 |   int ans=;s.size();
      |           ^
a.cc:6:18: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
    6 |   int ans=;s.size();
      |            ~~~~~~^~
In file included 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/c++/14/bits/basic_string.h:1076:7: note: declared here
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
Language: Java

import java.util.*;
class Main{
  public static void main(String args[]){
    Scanner s=new Scanner(System.in);
    String S=sc.next();
    int r=0;
    char b=S.charAt(0);
    for(i=1;i<S.length();i++){
      if(S.charAt(i)==r){
        res++;
        b=(S.charAt(i)=='0'?'1':'0');
      }
      else b=S.charAt(i);
    }
    System.out.println(r);
  }
}

Compiler output:
Main.java:5: error: cannot find symbol
    String S=sc.next();
             ^
  symbol:   variable sc
  location: class Main
Main.java:8: error: cannot find symbol
    for(i=1;i<S.length();i++){
        ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
    for(i=1;i<S.length();i++){
            ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
    for(i=1;i<S.length();i++){
                         ^
  symbol:   variable i
  location: class Main
Main.java:9: error: cannot find symbol
      if(S.charAt(i)==r){
                  ^
  symbol:   variable i
  location: class Main
Main.java:10: error: cannot find symbol
        res++;
        ^
  symbol:   variable res
  location: class Main
Main.java:11: error: cannot find symbol
        b=(S.charAt(i)=='0'?'1':'0');
                    ^
  symbol:   variable i
  location: class Main
Main.java:13: error: cannot find symbol
      else b=S.charAt(i);
                      ^
  symbol:   variable i
  location: class Main
8 errors
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define all(a) a.begin(),a.end()
#define sz(a) a.size()
#define re return 
#define MP make_pair
#define pb push_back
#define pii pair<int,int>
#define se second
#define fi first
using namespace std;
char s[100005],cmp1[100005],cmp2[100005];
int ans1,ans2;
signed main(){
	ios_base::sync_with_stdio(0);
	cin>>s;
	for(int i=0;i<sz(s);i++){
		if(i%2) cmp1[i]='1',cmp2[i]='0';
		else cmp1[i]='0',cmp2[i]='1';
	}
	for(int i=0;i<sz(s);i++){
		if(s[i]!=cmp1[i]) ans1++;
		if(s[i]!=cmp2[i]) ans2++;
	}
	cout<<min(ans1,ans2);
	re 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:17: error: request for member 'size' in 's', which is of non-class type 'char [100005]'
    4 | #define sz(a) a.size()
      |                 ^~~~
a.cc:17:23: note: in expansion of macro 'sz'
   17 |         for(int i=0;i<sz(s);i++){
      |                       ^~
a.cc:4:17: error: request for member 'size' in 's', which is of non-class type 'char [100005]'
    4 | #define sz(a) a.size()
      |                 ^~~~
a.cc:21:23: note: in expansion of macro 'sz'
   21 |         for(int i=0;i<sz(s);i++){
      |                       ^~
Language: Java

import java.util.*;
public class Main{
  public static void main (String [] args){
	String a = scanner.next();
    String b = "";
    if (a.charAt(0) == 0){
      for (int i = 0; i < a.size()/2 + 1; i++){
        b = b + "01";
      }
    }
    else{
      for (int i = 0; i < a.size()/2+1; i++){
        b = b + "10";
      }
    }
    int counter = 0;
    for (int i = 0; i < a.size(); i++){
      if (a.charAt(i) != b.charAt(i))
        counter++;
    }
    System.out.println(counter);
  }
}

Compiler output:
Main.java:4: error: cannot find symbol
	String a = scanner.next();
	           ^
  symbol:   variable scanner
  location: class Main
Main.java:7: error: cannot find symbol
      for (int i = 0; i < a.size()/2 + 1; i++){
                           ^
  symbol:   method size()
  location: variable a of type String
Main.java:12: error: cannot find symbol
      for (int i = 0; i < a.size()/2+1; i++){
                           ^
  symbol:   method size()
  location: variable a of type String
Main.java:17: error: cannot find symbol
    for (int i = 0; i < a.size(); i++){
                         ^
  symbol:   method size()
  location: variable a of type String
4 errors
Language: Java

import java.util.Scanner;
public class Main{
  public static void main (String [] args){
	String a = scanner.next();
    String b = "";
    if (a.charAt(0)){
      for (int i = 0; i < a.size()/2 + 1; i++){
        b = b + "01";
      }
    }
    else{
      for (int i = 0; i < a.size()/2+1; i++){
        b = b + "10";
      }
    }
    int counter = 0;
    for (int i = 0; i < a.size(); i++){
      if (a.charAt(i) != b.charAt(i))
        counter++;
    }
    System.out.println(counter);
  }
}

Compiler output:
Main.java:4: error: cannot find symbol
	String a = scanner.next();
	           ^
  symbol:   variable scanner
  location: class Main
Main.java:6: error: incompatible types: char cannot be converted to boolean
    if (a.charAt(0)){
                ^
Main.java:7: error: cannot find symbol
      for (int i = 0; i < a.size()/2 + 1; i++){
                           ^
  symbol:   method size()
  location: variable a of type String
Main.java:12: error: cannot find symbol
      for (int i = 0; i < a.size()/2+1; i++){
                           ^
  symbol:   method size()
  location: variable a of type String
Main.java:17: error: cannot find symbol
    for (int i = 0; i < a.size(); i++){
                         ^
  symbol:   method size()
  location: variable a of type String
5 errors
Language: Java

import java.util.Scanner;

public class class9 {

	public static void main(String[] args) {
		
		String S = "i";
		int x = 0;
		Scanner sc = new Scanner(System.in); 
		S = sc.nextLine();
		
		for(int i = 0; i < S.length(); i++)
		{
			if(S.charAt(i) == S.charAt(i + 1))
			{
				if(S.charAt(i + 1) == '0')
				{
					 S = S.substring(0, i) + '1' + S.substring(i + 1); 
					 x++;
				} else if(S.charAt(i + 1) == '1')
				{
					 S = S.substring(0, i) + '0' + S.substring(i + 1); 
					 x++;
				}
			}
		}
		System.out.println(x);

	}

}


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

#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int c = 0;
  for(int i = 0; i < s.size(); i++)c += (i + s[i]) % 2;
  cout << min(c, n - c) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: 'n' was not declared in this scope
    8 |   cout << min(c, n - c) << endl;
      |                  ^
Language: C++

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

int main() {
  strng S;
  
  int ansA = 0;
  int ansB = 0;
  
  for(int i=0; i<S.size(); i++){
    if(S.at(i)^i%2)ansA ++;
    else ansB ++;
  }
  
  cout << min(ansA, ansB) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'strng' was not declared in this scope
    5 |   strng S;
      |   ^~~~~
a.cc:10:18: error: 'S' was not declared in this scope
   10 |   for(int i=0; i<S.size(); i++){
      |                  ^
Language: C++

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

int main() {
  strng S;
  
  int ansA = 0;
  int ansB = 0;
  
  for(int i=0; i<S.size(); i++){
    if(S.at(i)^i%2)ansA ++;
    else ansB ++;
  }
  
  cout << min(ansA, ansB) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'strng' was not declared in this scope
    5 |   strng S;
      |   ^~~~~
a.cc:10:18: error: 'S' was not declared in this scope
   10 |   for(int i=0; i<S.size(); i++){
      |                  ^
Language: C++

#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define REV(i,n) for(int i=n-1;i>0;i--)
#define req(i,n,m) for(int i=n;i<m;i++)
#define REQ(i,n,m,l) for(int i=n;i<m;i+=l) 
#define _GLIBCXX_DEBUG
int INF = 1e9 + 7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
    unsigned day;
    if (dow < dow1) dow += 7;
    day = dow - dow1;
    day += 7 * n - 6;
    return day;
}
signed gcd(int x, int y) {
    if (y == 0)return x;
    return gcd(y, x % y);
}
signed lcm(int x, int y) {
    return x / gcd(x, y) * y;
}
unsigned DayToWeekNumber(unsigned day)
{
    return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
    return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
pair<string, int>A[101];
signed main() {
  string S; cin>>S;
  int count1=0;
  int count2=0;
  rep(i,S){
    if(i%2==0){
      if(S.at(i)=='0')count1++;
      else count2++;
    }
    else{
      if(S.at(i)=='1')count1++;
      else count2++;
    }
  }
  cout<<min(count1,count2)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:39: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   36 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                       ^~~~~~~~
a.cc:73:3: note: in expansion of macro 'rep'
   73 |   rep(i,S){
      |   ^~~