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

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main() {
  ll N; cin >> N;
  string S; cin >> S;
  ll ans = 0;
  if (N == 2) {
    if (S[0] == '#' && S[1] == '.') {
      cout << 1 << endl;
      return;
    }
  }
  for (ll j=1; j < N-1; ++j) {
    if (S[j-1] == '.' && S[j] == '#' && S[j+1] == '.') {
      S[j] = '.';
      ans += 1;
    } else if (S[j-1] == '#' && S[j] == '#' && S[j+1] == '.') {
      S[j+1] = '#';
      ans += 1;
    } else if (S[j-1] == '#' && S[j] == '.') {
      S[j-1] = '.';
      ans += 1;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   13 |       return;
      |       ^~~~~~
Language: C++

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

int main(){
	int d = 0;
    int s = 0;
	long long int sum1 = 0,sum2 = 0;
	long long int n;
	cin >> n;
	string a;
	cin >> a;
	for(int i = 0;i<n;i++){
		if((a[i] == '.') && (s == 1)){
			sum1 += 1;
		}
		else(a[i] == '#'){
			s = 1;
		}
	}
	for(int i = 1;i<=n;i++){
		if((a[n-i] == '#') && (d==1)){
			sum2 += 1;
		}
		else if(a[n-i] == '.'){
			d = 1;
		}
	}
if(sum1 >= sum2){
	cout << sum2;
}
else{
	cout << sum1;
}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:34: error: expected ';' before '{' token
   16 |                 else(a[i] == '#'){
      |                                  ^
      |                                  ;
Language: C++

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

int main(){
  long int n;
  cin >> n;
  string s;
  cin >> s;
  vector<char> S;
  vector<char> T;
  for(int i = 0;i < n;i++){
    S.push_back(s.at(i));
    T.push_back(s.at(i));
  }

  long int count_s = 0;
  for(int i = 1;i < n;i++){
    if(S[i-1] == '#' && S[i] == '.'){
      S[i] = '#';
      count_s++;
    }
  }

  ling int count_a = 0;
  for(int i = 0;i < n-1;i++){
    if(T[i] == '#'){
      T[i] = '.';
      count_a++;
    }
  }
  //cout << count_a << endl;
  cout << min(count_s,count_a) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:3: error: 'ling' was not declared in this scope; did you mean 'long'?
   26 |   ling int count_a = 0;
      |   ^~~~
      |   long
a.cc:30:7: error: 'count_a' was not declared in this scope; did you mean 'count_s'?
   30 |       count_a++;
      |       ^~~~~~~
      |       count_s
a.cc:34:23: error: 'count_a' was not declared in this scope; did you mean 'count_s'?
   34 |   cout << min(count_s,count_a) << endl;
      |                       ^~~~~~~
      |                       count_s
Language: Java

import java.util.Scanner;

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

        int n = sc.nextInt();
        String s = sc.next();

        int dotCnt = 0;
        int sharpCnt = 0;


        if (s.indexOf("#") != -1 && s.indexOf(".")!= -1) {
            String sMid = s.substring(s.indexOf("#"), s.lastIndexOf(".") + 1);
            System.out.println(sMid);
            for (int i = 0; i < sMid.length(); i++) {
                String str = String.valueOf(s.charAt(i));

                if (str.equals(".")) {
                    dotCnt++;
                } else {
                    sharpCnt++;
                }
            }
        }

        if (dotCnt <= sharpCnt){
            System.out.println(dotCnt);
        }else{
            System.out.println(sharpCnt);
        }


        sc.close();
    }


Compiler output:
Main.java:36: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include<cstdio>
#include<cmath>
#include<climits>
#include<algorithm>
#include<sstream>
#include<iostream>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<list>
#include<map>
#include<vector>

using namespace std;


#define rep(i,n) for(int i=0; i<n; i++)
#define rept(i,a,b) for(int i=a; i<b; i++)
#define ll long long
#define mod 1000000007

#define imin INT_MIN;
#define imax INT_MAX;


int main(){
	int n;
	string s;
	cin >> n >> s;
	int cnt=0;
	vector<int> counts;
	bool flag = false;
	rep(i, n-1) {
		if (s[i] == '#') {
			if (!flag) cnt++;
			else {
				flag = false;
				counts.push_back(cnt);
			}
		}
		else {
			if (flag) cnt++;
			else {
				flag = true;
				counts.push_back(cnt);
			}
		}
	}
	if (s[n-1] == '#') {
		if (!flag) counts.push_back(cnt+1);
		else {
			counts.push_back(cnt);
			counts.push_back(1);
		}
	}
	if (s[n-1] == '.') {
		if (flag) counts.push_back(cnt+1);
		else {
			counts.push_back(cnt);
			counts.push_back(1);
		}
	}

	int dt = 0;
	rep(i, counts.size()) {
		if (i % 2 == 1) dt += counts[i];
	}
	int sh = 0;
	int cnt = 0;
	
	vector<int> sharp, dot;
	int poscnt = 0, negcnt = 0;
	rep(i, counts.size()) {
		if (i % 2 == 0) {
			poscnt += counts[i];
			sharp.push_back(poscnt);
		}
		else {
			negcnt += counts[i];
			dot.push_back(negcnt);
		}
	}
	/*
	rep(i, sharp.size()) cout << sharp[i] << endl;
	rep(i, dot.size()) cout << dot[i] << endl;
	cout << sharp.size() << dot.size() << endl;
	*/

	vector<int> diff;
	rep(i, sharp.size()) {
		diff.push_back(dt + sh);
		sh += sharp[i];
		dt -= dot[i];
	}
	int mini = INT_MAX;
	rep(i, diff.size()) mini = min(mini, diff[i]);

	cout << mini << endl;


	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:70:13: error: redeclaration of 'int cnt'
   70 |         int cnt = 0;
      |             ^~~
a.cc:31:13: note: 'int cnt' previously declared here
   31 |         int cnt=0;
      |             ^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>

using namespace std;

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

    int n;
    string s;
    vector<int> ans;

    int fb = -1;
    int cw = 0, cb = 0;

    cin >> n;
    cin >> s;

    vector<int> ss(n+1);
    ss[0] = 0;
    for (int i = 0; i < n; i++)
    {
        ss[i+1] = ss[i] + (s[i] == '#');
    }

    for (int i = 0; i < n; i++)
    {
        if (s[i] == '#')
        {
            // for (int j = 0; j < n; j++)
            // {
            //     if (s[j] == '#')
            //     {
            //         if (j < i)
            //             lb++;
            //         else
            //             rb++;
            //     }
            // }
            const int lb = ss[i - 1] - ss[0];
            const int rb = ss[n] - ss[i];

            const int ln = i, rn = n - i;
            const int lw = ln - lb, rw = rn - rb;
            const int ww = lb + rb;
            const int wb = lb + rw;
            const int bb = lw + rw;
            ans.push_back(min(ww, wb, bb));
        }
    }

    if (ans.empty())
        cout << 0 << endl;
    else
        cout << *min_element(ans.begin(), ans.end());

    return 0;
}


Compiler output:
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: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:52:30:   required from here
   52 |             ans.push_back(min(ww, wb, bb));
      |                           ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

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

int main()
{
  int N;
  string S;
  cin>>N;
  cin>>S;
  int a=0;
  int b,c,db,e,ab;
  b=0;
  int d=0;
  for(int i=0;i<N;i++){
    if(S[i]=='.'&&a==i)a++;
  }
  if(a==0){
    for(int i=0;i<N;i++){
    if(S[i]=='#'&&ab==i)ab++;
    if(S[i]=='.'&&ab+a==i)a++;
    }
  }
  for(int i=0;i<N;i++){
    if(S[i]=='.')b++;
  }
  for(int i=0;i<N;i++){
    if(S[i]=='.') {
      if(d!=0) db=d;
      d=0;
    else d=d+1;
  }
  if(d==0)d=db;
  c=N-b;
  b=b-a;
  c=c-d;
  if(c>=b) cout<<b<<endl;
  else cout<<c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: expected '}' before 'else'
   30 |     else d=d+1;
      |     ^~~~
a.cc:27:19: note: to match this '{'
   27 |     if(S[i]=='.') {
      |                   ^
Language: C++

#include "pch.h"
/////ここから下を提出///////////////////////////////////////////////////////////////
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
//#include <istream>
//#include <sstream>
using namespace std;

int main()
{
	int N;
	string S1;
	string S2;
	int f = 0;
	int ANS1 = 0;
	int ANS2 = 0;
	cin >> N;
	cin >> S1;
	S2 = S1;

	for (int i = 0; i < N; i++)
	{
		if (S1[i] == '#'&&S1[i+1]=='.')
		{
			S1[i + 1] = '#';
			ANS1++;
		}
	}

	for (int i = 0; i < N; i++)
	{
		if (S2[i] == '#'&&i!=N-1)
		{
			ANS2++;
		}
	}
	cout << min(ANS1,ANS2) << endl;
}


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

#include <stdio.h>
#include <math.h>
int main(void){
    int N;
    scanf("%d",&N);
    char S[];
    scanf("%s",S);

    int flag = -1;
    int i = 0;
    for(i = 0; i < N; i++){
      if(S[i] == '#'){
        flag++;
        break;
      }
    }
    for(; i < N; i++){
      if(S[i] == '.'){
        flag++;
      }
    }
    if(flag == -1){
      flag = 0;
    }
    if(flag > N/2){
      flag = N - flag;
    }
    printf("%d",flag);

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:10: error: array size missing in 'S'
    6 |     char S[];
      |          ^
Language: C++

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

int main() {
    int N;
    char S[200010];
    char S_copy[200010];
    cin >> N;
    cin >> S;
    char black = '#';
    char white = '.';
    int res1=0;
    for (int i=0; i < N-1; i++) {
        if (S_copy[i] = black && S_copy[i+1] = white) {
            res1++;
        }
    }
    int res3=0;
    for (int i=N-1; i > 0; i--) {
        if(S_copy[i] = white && S_copy[i-1] = black ) {
            S_copy[i] = black;
            res3++;
        }
    }
    int res2 = 0;
    for (int i=1; i < N; i++) {
        if(S[i] == white && S[i-1] == black ) {
            S[i] = black;
            res2++;
        }
    }
    int res = min(res1, res2, res3);
    cout << res << "\n";

}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:31: error: lvalue required as left operand of assignment
   15 |         if (S_copy[i] = black && S_copy[i+1] = white) {
      |                         ~~~~~~^~~~~~~~~~~~~~
a.cc:21:30: error: lvalue required as left operand of assignment
   21 |         if(S_copy[i] = white && S_copy[i-1] = black ) {
      |                        ~~~~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:33:18:   required from here
   33 |     int res = min(res1, res2, res3);
      |               ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <cstdio>

int main()
{
	int r = 0;
	char c;
	int n;

	scanf_s("%d\n", &n);

	while ((c = getchar()) != 'EOF' && c != '#' && c != '\n') {}

	if (c == 'EOF' || c == '\n') {
		printf("0");
		return 0;
	}

	while ((c = getchar()) != 'EOF' && c != '\n') {
		if (c == '.') { r++; }
	}
	printf("%d\n", r);
	return 0;
}

Compiler output:
a.cc:11:35: warning: multi-character character constant [-Wmultichar]
   11 |         while ((c = getchar()) != 'EOF' && c != '#' && c != '\n') {}
      |                                   ^~~~~
a.cc:13:18: warning: multi-character character constant [-Wmultichar]
   13 |         if (c == 'EOF' || c == '\n') {
      |                  ^~~~~
a.cc:18:35: warning: multi-character character constant [-Wmultichar]
   18 |         while ((c = getchar()) != 'EOF' && c != '\n') {
      |                                   ^~~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    9 |         scanf_s("%d\n", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<cstdio>
#include<cmath>
#include<climits>
#include<algorithm>
#include<sstream>
#include<iostream>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<list>
#include<map>
#include<vector>

using namespace std;


#define rep(i,n) for(int i=0; i<n; i++)
#define rept(i,a,b) for(int i=a; i<b; i++)
#define ll long long
#define mod 1000000007

#define imin int_min;
#define imax int_max;


int main(){
	int n;
	string s;
	cin >> n >> s;
	int offset=0;
	rep(i, n) {
		if (s[i] == '.') offset++;
		else break;
	}
	int roffset=0;
	for(int i=n; i>0; i--) {
		if (s[i] == '#') roffset++;
		else break;
	}
	int cnt=0;
	vector<int> counts;
	bool flag = false;
	if (offset >= n-roffset) cout << 0 << endl;
	else {
		rep(i, n-1) {
			if (s[i] == '#') {
				if (!flag) cnt++;
				else {
					flag = false;
					counts.push_back(cnt);
				}
			}
			else {
				if (flag) cnt++;
				else {
					flag = true;
					counts.push_back(cnt);
				}
			}
		}
		if (s[n-1] == '#') {
			if (!flag) counts.push_back(cnt+1);
			else {
				counts.push_back(cnt);
				counts.push_back(1);
			}
		}
		if (s[n-1] == '.') {
			if (flag) counts.push_back(cnt+1);
			else {
				counts.push_back(cnt);
				counts.push_back(1);
			}
		}

		int dt = 0;
		rep(i, counts.size()) {
			if (i % 2 == 1) dt += counts[i];
		}
		int sh = 0;
		int cnt = 0;
		
		vector<int> sharp, dot;
		int poscnt = 0, negcnt = 0;
		rep(i, counts.size()) {
			if (i % 2 == 0) {
				poscnt += counts[i];
				sharp.push_back(poscnt);
			}
			else {
				negcnt += counts[i];
				dot.push_back(negcnt);
			}
		}
		/*
		rep(i, sharp.size()) cout << sharp[i] << endl;
		rep(i, dot.size()) cout << dot[i] << endl;
		cout << sharp.size() << dot.size() << endl;
		*/

		vector<int> diff;
		rep(i, sharp.size()) {
			diff.push_back(dt + sh);
			sh += sharp[i];
			dt -= dot[i];
		}
		int mini = int_max;
		rep(i, diff.size()) mini = min(mini, diff[i]);

		cout << mini << endl;
	}


	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:108:28: error: 'int_max' was not declared in this scope
  108 |                 int mini = int_max;
      |                            ^~~~~~~
Language: C

#include <stdio.h>

int main(void)
{
  int N,N_;
  scanf ("%d",&N);
  char S[N];
  scanf ("%s",S);
  int black,white;	//白は最も左の黒より右のみ数える
  while(N_<N)
  {
    if ((s[N_]='.')&&black!=0) white++;	//白
    else black++;
    N_++;
  }
  if (black>=white) printf ("%d",white);
  else printf ("%d",black);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:10: error: 's' undeclared (first use in this function)
   12 |     if ((s[N_]='.')&&black!=0) white++; //白
      |          ^
main.c:12:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main(void){
  int n;cin >> n;
  string s;cin >> s;int a=0;int b = n-1;
  while(a<n　and s.at(a) == '.' ){
    a++;
  }
  while(b>= 0 and s.at(a) == '#' ){
    b--;
  }
  int u = 0;int t = 0;
  for(int i = a;i<=b;i++){
    if(s.at(i) == '#'){
      u++;
    }else{
      t++;
    }
  }
  cout << min(u,t) << endl;
}

Compiler output:
a.cc:9:11: error: extended character 　 is not valid in an identifier
    9 |   while(a<n　and s.at(a) == '.' ){
      |           ^
a.cc: In function 'int main()':
a.cc:9:11: error: 'n\U00003000and' was not declared in this scope
    9 |   while(a<n　and s.at(a) == '.' ){
      |           ^~~~~~
a.cc:9:17: error: expected ')' before 's'
    9 |   while(a<n　and s.at(a) == '.' ){
      |        ~        ^~
      |                 )
a.cc:9:32: error: expected ';' before ')' token
    9 |   while(a<n　and s.at(a) == '.' ){
      |                                ^~
      |                                ;
Language: C

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

int main(){

	int N,len,i,a=0;
	char S;
	
	scanf("%d",N);
	scanf("%s",S);
	

	len=strlen(S);
	
	for(i=0;i<len-1;i++){
		if(S[i]=='#'&&S[i+1]=='.'){
			a=a+1;
		}
	}
	
	printf("%d",a);
}

Compiler output:
main.c: In function 'main':
main.c:13:20: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   13 |         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:16:21: error: subscripted value is neither array nor pointer nor vector
   16 |                 if(S[i]=='#'&&S[i+1]=='.'){
      |                     ^
main.c:16:32: error: subscripted value is neither array nor pointer nor vector
   16 |                 if(S[i]=='#'&&S[i+1]=='.'){
      |                                ^
Language: C++

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

int main() {
    int N;
    char S[200010];
    char S_copy[200010];
    cin >> N;
    cin >> S;
    char black = '#';
    char white = '.';
    int res1=0;
    for (int i=0; i < N-1; i++) {
        if (S_copy[i] == black && S_copy[i+1] == white) {
            res1++;
        }
    }
    int res3=0;
    for (int i=N-1; i > 0; i--) {
        if(S_copy[i] == white && S_copy[i-1] == black ) {
            S_copy[i] = black;
            res3++;
        }
    }
    int res2 = 0;
    for (int i=1; i < N; i++) {
        if(S[i] == white && S[i-1] == black ) {
            S[i] = black;
            res2++;
        }
    }
    int res = min(res1, res2, res3);
    cout << res << "\n";

}


Compiler output:
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:33:18:   required from here
   33 |     int res = min(res1, res2, res3);
      |               ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n, r = 0, l = 0, i;
    string s, tmp;
    cin >> n >> s;
    tmp = s;
    for (i = 0; i < n - 1; ++i) {
        if (s[i] == '#' && s[i+1] == '.') {
            r++;
            s[i+1] = '#';
        }
        else if(s[n - i] == '.' && s[n - i - 1]) {
            l++;
            e[n - i - 1] = '.';
        }  
    }
    if (r <= l) cout << r << endl;
    else cout << l << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'e' was not declared in this scope
   15 |             e[n - i - 1] = '.';
      |             ^
Language: Java

public static void main (String [] args) throws IOException{
   String input;
   int length = 0;
   int count = 0;
   StringBuilder sb;
 
   BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
   length = Integer.parseInt(stdin.readLine());
   input = stdin.readLine();
   sb = new StringBuilder(input);
 
    for (int index = 0; index <= length-2; index++){
      if (input.charAt(index) == '#' && input.charAt(index+1) == '.'){
        sb.setCharAt(index+1, '#');
        count++;
      }
    }
    System.out.println(count);
   }
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main (String [] args) throws IOException{
              ^
  (use --enable-preview to enable unnamed classes)
Main.java:20: error: class, interface, enum, or record expected
}
^
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
    string s;
    ll n;
    cin>>n>>s;
    ll count11=0,count21=0,count22=0,black=0;
    string a=b=s;
    for(ll i=0;i<n;i++){
        if(count11==0){
            if(s[i]=='#'){
                count11=1;
                if(i!=n-1)count22++;
            }
        }
        else{
            if(s[i]=='.')count21++;
            if(s[i]=='#')count22++;
        } 
        if(s[i]=='.')black=0;
        if(s[i]=='#')black++;
    }

    if(count22-black>count21)cout<<count21<<endl;
    else cout<<count22-black<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: 'b' was not declared in this scope
    9 |     string a=b=s;
      |              ^
Language: C++

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

int main()
{
  int n;
  string s;
  cin >> n >> s;
  int i;
  int point = 1000000;
  int countb = 0;
  int countw = 0;
  int ch = 0;
  for(i = 0; i < n; i++)
  {
    if(s.at(i) == '#')
    {
      point = i;
      break;
    }
  }
  if(point == 1000000)
  {
    ch = 1;
  }
  else
  {
    for(i = point; i < n; i++)
    {
      if(s.at(i) == '#')
      {
        countb++;
      }
      else
      {
        countw++;
      }
    }
  }
  /*if(ch == 1)
  {*/
    cout << 0 << endl;
  }/*
  else
  {
    cout << min(countb, countw) << endl;
  }*/
}


Compiler output:
a.cc:48:1: error: expected declaration before '}' token
   48 | }
      | ^
Language: C++

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
using namespace std;
const int inf=2147483647,dx[]={-1,0,1,0},dy[]={0,-1,0,1};// 上 左 下 右
const int N=100005,M=1000005,mod=1000000007;
const long long llinf=9223372036854775807ll;
int n,ans;
bool ok;
string s;
int main(){
	cin>>n>>s;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='#')
			ok=true;
		if(ok&&s[i]=='.')
			ans++
	}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:30: error: expected ';' before '}' token
   27 |                         ans++
      |                              ^
      |                              ;
   28 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,counter=0,i;
  string S;
  cin>>N>>S;
  bool f=false;
  for(i=0;i<N;i++){
    if(S[i]=='#'){
      f=true;
      i++;
      break;
    }
  }
  if(f){
    for(int j=i;j<N;j++){
      if(S[j]=='.')counter++;
    }
  }
  f=false;
  int counter2=0;
  for(i=N-1;i>=0;i--){
    if(S[i]=='.'){
      f=true;
      i--;
      break;
    }
  }
  if(f){
  for(j=i;j<=0;j++){
    if(S[j]=='#')counter2++;
  }
  }
  cout<<min(counter,counter2)<<endl;
}
    

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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,counter=0,i;
  string S;
  cin>>N>>S;
  bool f=false;
  for(i=0;i<N;i++){
    if(S[i]=='#'){
      f=true;
      i++;
      break;
    }
  }
  if(f){
    for(int j=i;j<N;j++){
      if(S[j]=='.')counter++;
    }
  }
  f=false;
  int counter2=0;
  for(i=N-1;i>=0;i--){
    if(S[i]=='.'){
      f=true;
      i--;
      break;
    }
  }
  for(j=i;j<=0;j++){
    if(S[j]=='#')counter2++;
  }
  cout<<min(counter,counter2)<<endl;
}
    

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

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

public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		//BufferedReader in = new BufferedReader(new FileReader(new File("input.txt")));
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		in.readLine();
		StringBuilder s = new StringBuilder(in.readLine());
		StringBuilder b = new StringBuilder(s.toString());
		int numA = 0;
		for(int i = 0; i< s.length()-2; i++) {
			if(i==0&&s.charAt(0) =='.'){continue;}
			if(s.charAt(i) == '#' &&  s.charAt(i+1) == '.') {
				numA++;
				s=s.deleteCharAt(i+1);
				s=s.insert(i+1, '#');
			}
		}
		int numB = 0;
		for(int i = 0; i< b.length()-1; i++) {
			//if(i==1&&b.charAt(0) =='.'){continue;}
			if(b.charAt(i) == '#') {
				numB++;
			}
		}
		System.out.println(numA<numB?numA:numB);

Compiler output:
Main.java:28: error: reached end of file while parsing
		System.out.println(numA<numB?numA:numB);
		                                        ^
1 error
Language: C++

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int N,count;
    bool flag = false;
    count = 0;
    cin >> N;
    cin >> S;
    
    for(int i=0;i<N;i++){
        if(flag){
            if (S[i] == '.'){
                count++;
            }
        }
        else if (S[i] == '#' && S[i+1] == '.') {
            flagt = true;
        }
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'S' was not declared in this scope
   10 |     cin >> S;
      |            ^
a.cc:19:13: error: 'flagt' was not declared in this scope; did you mean 'flag'?
   19 |             flagt = true;
      |             ^~~~~
      |             flag
Language: C

#include <stdio.h>

int main(void){
    int N,i,C=0;
    char S[200010];

    scanf("%d", &N);
    scanf("%s", S);

    for(i=1;i<=200000;i++){
        if(S[i-1] == '#' && S[i]=='.'){
            C=C+1;
            S[i]='#'
        }
    }
    printf("%d\n",C);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:21: error: expected ';' before '}' token
   13 |             S[i]='#'
      |                     ^
      |                     ;
   14 |         }
      |         ~
Language: C++

#define __USE_MINGW_ANSI_STDIO 0
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <set>
#include <numeric>
#include <bitset>
#include <map>
#include <limits.h>
using namespace std;
typedef unsigned long ul;
typedef pair<ul, ul> P;
const int INF = 1e9;

long long gcd(long long x, long long y){
			if(x<y){
				long long temp = x;
			x = y;
				y = temp;
			}
			long long r = x % y;
				while(r!=0){
					x = y;
					y = r;
				r = x % y;
	    		}
			return y;
	    }

int main(){
int N;
string S_1;
cin >> N;
cin >> S_1;
int n;
int cnt_1 = 0;
int cnt_2 = 0;
string S_2 = S_1;
string S_1r =S_1;
string S_2r =S_1;
reverse(S_1r.begin(),S_1r.end());
reverse(S_2r.begin(),S_2r.end());
int cnt_1r = 0;
int cnt_2r = 0;
for(int i = 0; i< N-1;i ++){
    if(S_1[i] == '#' && S_1[i+1] =='.'){
        cnt_1++;
        S_1[i+1] = '#';
    }
for(int i = 0; i< N-1;i ++){
    if(S_1r[i] == '.' && S_1[i+1] =='#'){
        cnt_1r++;
        S_1r[i] = '#';
    }
    if(cnt_1 = 0)cnt_1 = cnt_1r;
for(int i = 0; i< N-1;i ++){
    if(S_2[i] == '#' && S_2[i+1] =='.'){
        cnt_2++;
        S_2[i] = '.';
    
    }
}
   for(int i = 0; i< N-1;i ++){
    if(S_2r[i] == '.' && S_2[i+1] =='#'){
        cnt_2r++;
        S_2r[i+1] = '.';
    }
}
if(cnt_2 = 0)cnt_2 = cnt_2r;

cout << min(cnt_1,cnt_2) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:76:2: error: expected '}' at end of input
   76 | }
      |  ^
a.cc:49:28: note: to match this '{'
   49 | for(int i = 0; i< N-1;i ++){
      |                            ^
a.cc:76:2: error: expected '}' at end of input
   76 | }
      |  ^
a.cc:34:11: note: to match this '{'
   34 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;
 
int main()
{
  int N, count1 = 0, count2 = 0, j;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N - 1; i++)
  {
    if (S.at(i) == '#' && S.at(i + 1) == '.')
      count1++;
  }
  for (int i = 0; i < N - 1; i++)
  {
    if (S.at(i + 1) == '#' && S.at(i) == '.')
    {
      j = i + 1
      while (S.at(j) == '#')
      count2++;
      j++;
    }
  }
  cout << min(count1, count2) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: expected ';' before 'while'
   18 |       j = i + 1
      |                ^
      |                ;
   19 |       while (S.at(j) == '#')
      |       ~~~~~
Language: C

#include <stdio.h>
 
int main(void)
{
    int i, N,
    long cnt = 0;
    scanf("%d", &N);
    char str[N];
    scanf("%s", str);

    for (i = N - 1; i > 0; i--){
        if(str[i] == '.' && str[i - 1] == '#'){
            cnt++;
        }else{
            continue;
        }
    }

    printf("%ld\n", cnt);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:5: error: expected identifier or '(' before 'long'
    6 |     long cnt = 0;
      |     ^~~~
main.c:13:13: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
   13 |             cnt++;
      |             ^~~
      |             int
main.c:13:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
using namespace std;
 
int main()
{
  int N, count1 = 0, count2 = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N - 1; i++)
  {
    if (S.at(i) == '#' && S.at(i + 1) == '.')
      count1++;
  }
  for (int i = 0; i < N - 1; i++)
  {
    if (S.at(i + 1) == '#' && S.at(i) == '.')
    {
      j = i + 1
      while (S.at(j) == '#')
      count2++;
      j++;
    }
  }
  cout << min(count1, count2) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'j' was not declared in this scope
   18 |       j = i + 1
      |       ^
Language: C++

#include <bits/stdc++.h>
#define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i];
typedef long long int ll;
using namespace std;

int main(){
	int n; cin >>n;
	string s; cin >>s;
	vector<int>a;
	int i=0;
	int cnt=1;
	while(i<s.size()-1){
      if(s[i]==s[i+1] ){
      	cnt++;
      	i++;
      }
      else{
      	a.push_back(cnt);
      	cnt=1;
      	i++;
      }
	}
    a.push_back(cnt);
    int bsum=0;
    int wsum=0;
    
    if(s[0]=='.'){
    	int ans=20000000;
    	for(int i=1;i<a.size();i+=2)
    		bsum+=a[i];
    	for(int i=2;i<a.size();i+=2)
    		wsum+=a[i];
    	if(a.size()%2 ==0){
    		int cntb=bsum;
    		int cntw=wsum;
    		ans=min(ans,cntb);
    		ans=min(ans,cntw);
    		cntb=0;
    		for(int i=1;i<=a.size()/2;i++){
    			cntw-=a[i*2];
    			cntb+=a[i*2-1];

    			ans=min(ans,cntb+cntw);

    		}
    	}
    	if(a.size()%2 ==1){
    		int cntb=bsum;
    		int cntw=wsum;
    		ans=min(ans,cntb);
    		ans=min(ans,cntw);
    		cntb=0;
    		for(int i=1;i<=(a.size()-1)/2;i++){
    			cntw-=a[i*2];
    			cntb+=a[i*2-1];

    			ans=min(ans,cntb+cntw);

    		}
    	}


    }
    if(s[0]=='#'){
    	int ans=20000000;
    	for(int i=0;i<a.size();i+=2)
    		bsum+=a[i];
    	for(int i=1;i<a.size();i+=2)
    		wsum+=a[i];
    	if(a.size()%2 ==1){
    		int cntb=bsum;
    		int cntw=wsum;
    		ans=min(ans,cntb);
    		ans=min(ans,cntw);
    		cntb=0;
    		for(int i=1;i<=(a.size()+1)/2;i++){
    			cntw-=a[i*2-1];
    			cntb+=a[i*2-2];

    			ans=min(ans,cntb+cntw);

    		}
    	}
    	if(a.size()%2 ==0){
    		int cntb=bsum;
    		int cntw=wsum;
    		ans=min(ans,cntb);
    		ans=min(ans,cntw);
    		cntb=0;
    		for(int i=1;i<=(a.size()-1)/2;i++){
    			cntw-=a[i*2-1];
    			cntb+=a[i*2-2];

    			ans=min(ans,cntb+cntw);

    		}
    	}


    }
    cout << ans << endl;
}


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

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

using namespace std;

int main(){
    int N;
    string S;
    cin >> N;
    cin >> S;
    int count_white, count_black, count_bw = 0;
    // all white
    for(int i = 0; i < N; i++){
        if(S.at(i) == '#') count_white++;
    }
    for(int i = 0; i < N; i++){
        if(S.at(i) == '.') count_black++;
    }
    for(int i = 0; i < count_white; i++){
        if(S.at(i) == '#') count_bw++;
    }
    for (int i = count_white; i < N; i++){
        if(S.at(i) == '.') count_bw++;
    }

    cout << min(count_white, count_bw, count_black) << endl;
}

Compiler output:
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: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:28:16:   required from here
   28 |     cout << min(count_white, count_bw, count_black) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: Java

import java.util.Scanner;
public class p3_ {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		
		// 整数の入力
		int N = sc.nextInt();
		
		String S = sc.next();
		
		int tmp_a = 0;
		int n_s = 0;
		int n_d = N - n_s;
		
		String[] a = S.split("");
		char[] b = new char[S.length()];
		
		for(int k = 0; k < N; k++) {
			b[k] = a[k].charAt(0);
			if(b[k] == '#') {
				n_s++;
			}
		}
		
		if(n_s > n_d) {
			tmp_a = n_d;
		}
		else {
			tmp_a = n_s;
		}
		// 出力
		System.out.println(tmp_a);
	}
}

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  string S; int N; cin >> N >> S;
  int min = N;
  int c = 0;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N ++j) {
      if (j < i) {
        if (S[j] != ".") {
          c++;
        }
      } else {
        if (S[j] != "#") {
          c++;
        }
      }
    }
    if (min > c) {
      min = c;
    }
  }
  cout << min << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:29: error: expected ';' before 'j'
    8 |     for (int j = 0; j < N ++j) {
      |                             ^
      |                             ;
a.cc:10:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if (S[j] != ".") {
a.cc:14:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |         if (S[j] != "#") {
Language: C++

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

int main(){

  int N; cin >> N;
  string S; cin >> S;

  int tmp0 = 0;
  int tmp1 = 0;
  int time = 0;


  for(int i = 0 ; i < N ; ++i){

    if(S[i] == '#' && S[i-1] == '.'){
      time += min(tmp0, tmp1);
      tmp0 = 0; tmp1 = 0;
    }

    if(S[i] == '#') tmp0++;
    if(S[i] == '.') tmp1++;
    // cout << tmp0 << "\t" << tmp1 << endl;

    if(i == N-1){
      time += min(tmp0, tmp1);
    }

    if(i == N-1 && S[i] == '.'){
      time -= tmp0;
      time += tmp1;

    }

  cout << time << endl;
  


}

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

int n, cnt=0,key=0;
	string str;
	
	cin >> n;
	cin >> str;
	
	char log[n] = {};
	
	if(n != 1 &&str[0] == '#' && str[1] == '.'){
		str[0] = '.';
		cnt++;
		//cout << str <<endl;
	}
	for(int i=0 ; i<n-2 ; i++) {
		if(equal(str.begin()+i, str.begin() + i+3 , ".#.")){
			str[i+1] = '.';
			cnt++;
			i++;
		} else if(equal(str.begin()+i, str.begin() + i+3 , "##.")) {
			str[i+2] = '#';
			cnt++;
		}
		//cout << str << i<< endl;
	}
/*
	while(1) {
		key = str.find(".#.");
		if(key== string::npos) {
			//break;
		} else {
			str[key+1] = '.';
			//log[key] = '1';
			cnt++;
			//cout << str<< endl;
		}
		
		key = str.find("##.");
		if(key== string::npos) {
			break;
		} else {
			str[key+2] = '#';
			//log[key] = '1';
			cnt++;
			//cout << str<< endl;
		}
	}
*/	
	/*
	for(int i=0 ; i<n ; i++) {
		if(log[n] == '1') cnt++;
	}
	*/
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc:2:9: error: 'string' does not name a type
    2 |         string str;
      |         ^~~~~~
a.cc:4:9: error: 'cin' does not name a type
    4 |         cin >> n;
      |         ^~~
a.cc:5:9: error: 'cin' does not name a type
    5 |         cin >> str;
      |         ^~~
a.cc:7:18: error: size of array 'log' is not an integral constant-expression
    7 |         char log[n] = {};
      |                  ^
a.cc:7:14: warning: built-in function 'log' declared as non-function [-Wbuiltin-declaration-mismatch]
    7 |         char log[n] = {};
      |              ^~~
a.cc:9:9: error: expected unqualified-id before 'if'
    9 |         if(n != 1 &&str[0] == '#' && str[1] == '.'){
      |         ^~
a.cc:14:9: error: expected unqualified-id before 'for'
   14 |         for(int i=0 ; i<n-2 ; i++) {
      |         ^~~
a.cc:14:23: error: 'i' does not name a type
   14 |         for(int i=0 ; i<n-2 ; i++) {
      |                       ^
a.cc:14:31: error: 'i' does not name a type
   14 |         for(int i=0 ; i<n-2 ; i++) {
      |                               ^
a.cc:53:9: error: 'cout' does not name a type
   53 |         cout << cnt << endl;
      |         ^~~~
a.cc:54:9: error: expected unqualified-id before 'return'
   54 |         return 0;
      |         ^~~~~~
a.cc:55:1: error: expected declaration before '}' token
   55 | }
      | ^
Language: C++

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

using namespace std;

int main(){

	int n, w=0, b=0, mi, flag=2;
	string s;
	vector<int> fb, v;

	cin>> n;
	cin>> s;

	if(s[0]=='#'){
		fc=1;
	}else{
		fc=0;
	}

	for(int i=0;i<n;i++){
		if(s[i]=='#'){
			b++;
			if(flag==0) fb.emplace_back(i);
			flag=1;
		}else{
			w++;
			flag=0;
		}
	}

	v.resize(n);

	for(int i=0;i<fb.size();i++){
		for(int j=0;j<n;j++){
			if((j<=fb[i] && s[j]=='#') || (fb[i]<j && s[j]=='.')) v[i]++;
		}
	}

	mi=min(w, b);
	for(int i=0;i<n;i++){
		mi=min(mi, v[i]);
	}

	cout<< mi << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'fc' was not declared in this scope; did you mean 'fb'?
   18 |                 fc=1;
      |                 ^~
      |                 fb
a.cc:20:17: error: 'fc' was not declared in this scope; did you mean 'fb'?
   20 |                 fc=0;
      |                 ^~
      |                 fb
Language: Java

public class Main {

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

		int n = in.nextInt();
		String s = in.next();

		solve(n, s);

		in.close();

	}

	private static void solve(int n, String s) {
		
		int ans = 0;
		String progress = s;
		while(true) {
			if(progress.contains("#.")) {
				progress = progress.replaceFirst("[#][.]", "##");
				ans += 1;
			} else {
				break;
			}
		}
		System.out.println(ans);
	}

}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		                             ^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		                                                ^
  symbol:   class InputStreamReader
  location: class Main
4 errors
Language: C++

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

int main(){
    int N, cntw, cntb, start;
    string S;
    cin >> N >> S;
    cntw = cntb = 0;
    ans = 0;
    for(int i = 0; i < N; i++){
        if(S[i] == '#') {
            start = i;
            break;
        }
    }
    for(int i = start; i < N; i++){
        if(S[i] == '#') cntb++;
        else cntw++;
    }
    if(cntb < cntw){
        cout << cntb << endl;
    } else {
        cout << cntw << endl;
    }
    return 0;
}

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

#include <stdio.h>

int main(){

      int i,j,a=0,b=0,N;
      scanf("%d",&N);

      char stone[N];

      scanf("%s",stone);
      
      }
      for(i=0;stone[i] != '\0';i++){
            if(stone[i] =='#' && stone[i+1] == '.'){
                  for(j=i;stone[j] != '\0';j++){
                        a++;
                        if(stone[j+1] == '.'){
                              b++;
                              break;
                        }
                  }
            }
      }
      
      }
      for(i=N;i >= 0;i--){
            if(stone[i] =='.' && stone[i-1] == '#'){
                  for(j=i;j>=0;j--){
                        b++;
                        if(stone[j-1] == '#'){
                              b++;
                              break;
                        }
                  }
            }
      }
      if(a < b){
            printf("%d",a);
     }else{
            printf("%d",b);
      }
}


Compiler output:
main.c:13:7: error: expected identifier or '(' before 'for'
   13 |       for(i=0;stone[i] != '\0';i++){
      |       ^~~
main.c:13:21: error: 'i' undeclared here (not in a function)
   13 |       for(i=0;stone[i] != '\0';i++){
      |                     ^
main.c:13:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '!=' token
   13 |       for(i=0;stone[i] != '\0';i++){
      |                        ^~
main.c:13:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   13 |       for(i=0;stone[i] != '\0';i++){
      |                                 ^~
main.c:25:7: error: expected identifier or '(' before '}' token
   25 |       }
      |       ^
main.c:26:7: error: expected identifier or '(' before 'for'
   26 |       for(i=N;i >= 0;i--){
      |       ^~~
main.c:26:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
   26 |       for(i=N;i >= 0;i--){
      |                 ^~
main.c:26:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
   26 |       for(i=N;i >= 0;i--){
      |                       ^~
main.c:37:7: error: expected identifier or '(' before 'if'
   37 |       if(a < b){
      |       ^~
main.c:39:7: error: expected identifier or '(' before 'else'
   39 |      }else{
      |       ^~~~
main.c:42:1: error: expected identifier or '(' before '}' token
   42 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long ;
  string S;
  cin >> N >> S;
  int color;
  vector<int> vec;
  if(S.at(0) == '.'){
      color = 0;
  }
  else{
      color = 1;
  }
  for(int i = 1;i < N;i++){
      if(S.at(i) != S.at(i-1)){
          vec.push_back(i);
      }
  }
  int minimum = N;
  if(vec.size() == 0){
      minimum = 0;
  }
  else if(color == 0){
    for (int i = 0; i < vec.size(); i += 2) {
      int sum = 0;
      for (int j = 1;j < i; j += 2){
          sum +=(vec.at(j) - vec.at(j-1));
      }
      for (int k = i + 2;k < vec.size(); k += 2){
          sum +=(vec.at(k) - vec.at(k-1));
      }
      if(vec.size() % 2 == 0){
          sum += ( N - vec.at(vec.size() - 1));
      }
      minimum = min(minimum,sum);
    }  
  }
  else if(color == 1){
    for (int i = 1; i < vec.size(); i += 2) {
      int sum = 0;
      sum += vec.at(0);
      for (int j = 1;j < i; j += 2){
          sum +=(vec.at(j) - vec.at(j-1));
      }
      for (int k = i + 2;k < vec.size(); k += 2){
          sum +=(vec.at(k) - vec.at(k-1));
      }
      if(vec.size() % 2 == 1){
          sum += ( N - vec.at(vec.size() - 1));
      }
      minimum = min(minimum,sum);
    }  
  }
  cout << minimum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: declaration does not declare anything [-fpermissive]
    5 |   long ;
      |   ^~~~
a.cc:7:10: error: 'N' was not declared in this scope
    7 |   cin >> N >> S;
      |          ^
Language: C++

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

template<typename T>
void remove(std::vector<T>& vector, unsigned int index) {
    vector.erase(vector.begin() + index);
}

template<class T>
T ma(vector<T> &v) {
    T maxi = 0;
    for (auto &i:v) maxi = max(maxi, i);
    return maxi;
}

#define rep(i, n, m) for (int i = n; i <= m; i++)
#define Rep(i, n, m) for (int i = m; i >= 1; i--)

typedef long long ll;
typedef unsigned long long ull;

long long ans = 0;

int main() {
    ull n;
    cin >> n;
    string s;
    cin >> s;
    bool bf = false;
    int black = 0;
    rep(i, n-1, 0) {
        if (s[i] == '#') {
            black++;
        } else {
            breal;
        }
    }
    int next = 0, b = 0, w = 0;
    rep(i, 0, n-black-1) {
        if (bf == false && s[i] == '.') {
            next++;
            continue;
        }

        if (s[i] == '#') {
            bf = true;
            b++;
        }
        else w++;
    }
    ans = n - black - next - min(b, w);
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:13: error: 'breal' was not declared in this scope
   35 |             breal;
      |             ^~~~~
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int N,K;
		String S;
		Scanner sc=new Scanner(System.in);	
		N=sc.nextInt();
		S=sc.next();
		char c[]=S.toCharArray();
		int num=0;
		
		for(int i=0;i<N;i++) {
			if(i!=N-1) {
				if(c[i]=='#'&&c[i+1]=='.') {
					num++;
					c[i]='.';
					if(i-1>0) {
						i=i-1;
					}
				}
			}
			
		}
			
		System.out.println(num);
	}

Compiler output:
Main.java:28: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

#include <string>
#include <iostream>
using namespace std;
int main(){
  int n;cin>>n;
  string s;cin>>s;
  bool isS = false, isD = false;
  int r1=0,r2=0,r3=0;
  for(int i=n-1;i>=0;i--) {
    if (s.at(i) == '#') {
      r1++; isS = true;
      if (isD) r3++;
    } else if (isS) {
      r2++;
      isD = true;
    }
 }
  #cout << r1 << " " << r2 << " " << r3 << endl;
 cout << min(r3,min(r1,r2)) << endl;
}
    

Compiler output:
a.cc:18:4: error: invalid preprocessing directive #cout
   18 |   #cout << r1 << " " << r2 << " " << r3 << endl;
      |    ^~~~