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

#include<iostream>
#include<string>
using namespace std;
int main()
{
  string s,result;
  cin >> s;
  for(int i = 0;i < strlen(s.c_str()); i++)
  {
    if(s[i] != 'B')
    {
      result += s[i];
    }
    else
    {
      result.pop_back();
    }
  }

  cout << result << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: 'strlen' was not declared in this scope
    8 |   for(int i = 0;i < strlen(s.c_str()); i++)
      |                     ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
  string s,result;
  cin >> s;
  for(int i = 0;i < strln(s.c_str()); i++)
  {
    if(s[i] != 'B')
    {
      result += s[i];
    }
    else
    {
      result.pop_back();
    }
  }

  cout << result << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: 'strln' was not declared in this scope
    8 |   for(int i = 0;i < strln(s.c_str()); i++)
      |                     ^~~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin >> n;
  cout << n(n + 1)/2 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'n' cannot be used as a function
    7 |   cout << n(n + 1)/2 << endl;
      |           ~^~~~~~~
Language: C++

#include<iostream>
using namespace std;
int mian()
{
  int n;
  cin >> n;
  cout << n(n + 1)/2 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int mian()':
a.cc:7:12: error: 'n' cannot be used as a function
    7 |   cout << n(n + 1)/2 << endl;
      |           ~^~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
    int n;
    cin>>n;
    cout<<n*(n+1)/2<<endl;
    return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: expected ';' before '}' token
    8 |     return 0
      |             ^
      |             ;
    9 | }
      | ~
Language: C++

#include<iostream>
using namespace std;

int main(int argc, char const *argv[]) {

  int n,sum;
  sum=0;
  cin>>n;

  for(i=1;i<n+1;i++){
    sum+=i;
  }

  cout<<sum;

  return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   for(i=1;i<n+1;i++){
      |       ^
Language: C++

#include<iostream>
using namespace std;

int int main(int argc, char const *argv[]) {

  int n,sum;
  sum=0;
  cin>>n;

  for(i=1;i<n+1;i++){
    sum+=i;
  }

  cout<<sum;

  return 0;
}


Compiler output:
a.cc:4:1: error: two or more data types in declaration of 'main'
    4 | int int main(int argc, char const *argv[]) {
      | ^~~
Language: C

#include <iostream>
#define sqr(n) (n)*(n)
#define min(a,b) a<b?a:b
using namespace std;
int main(void){
  int n,a[100],w;
  long long s,ans=10000000000;
  cin>>n;
  for(int i=0;i<n;i++)
    cin>>a[i];
  for(w=-100;w<=100;w++){
    s=0;
    for(int j=0;j<n;j++)
      s+=sqr(a[j]-w);
    ans=min(ans,s);
  }
  cout<<ans<<endl;
  return 0;
}

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

    import java.util.*;
    public class Main {
    public static void main(String[] args){
     
    Scanner s = new Scanner(System.in);
     
    int x = s.nextInt();
     
  System.out.println(n*(n+1)/2);
     
     
    }
     
     
    }

Compiler output:
Main.java:9: error: cannot find symbol
  System.out.println(n*(n+1)/2);
                     ^
  symbol:   variable n
  location: class Main
Main.java:9: error: cannot find symbol
  System.out.println(n*(n+1)/2);
                        ^
  symbol:   variable n
  location: class Main
2 errors
Language: Java

    import java.util.*;
    public class Main {
    public static void main(String[] args){
     
    Scanner s = new Scanner(System.in);
     
    int x = s.nextInt();
     
    return n*(n+1)/2;
     
     
    }
     
     
    }

Compiler output:
Main.java:9: error: incompatible types: unexpected return value
    return n*(n+1)/2;
                  ^
Main.java:9: error: cannot find symbol
    return n*(n+1)/2;
           ^
  symbol:   variable n
  location: class Main
Main.java:9: error: cannot find symbol
    return n*(n+1)/2;
              ^
  symbol:   variable n
  location: class Main
3 errors
Language: Java

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

public class Candy {

	public static void main(String[] args)throws IOException{
		// TODO 自動生成されたメソッド・スタブ

		int sum=0;
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader reader = new BufferedReader(is);

		System.out.print("人数を入力：");

		String str=reader.readLine();


		int N =Integer.parseInt(str);

		for(int i=1;i<=N;i++){
			sum = sum + i;
		}

		System.out.println("必要なキャンディーは："+sum);

	}

}


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

#include <stdio.h>

int main (void)
{
	int N;
	scanf("%d",N);
	pirntf("%d",N*(N+1)*(1/2));
	
	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'pirntf'; did you mean 'printf'? [-Wimplicit-function-declaration]
    7 |         pirntf("%d",N*(N+1)*(1/2));
      |         ^~~~~~
      |         printf
Language: C++

#include <bits/stdc++.h>
#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(auto it=(X).begin();it!=(X).end();it++)
#define numa(x,a) for(auto x: a)
#define ite iterator
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define pf push_front
#define sec second
#define sz(x) ((int)(x).size())
#define ALL( c ) (c).begin(), (c).end()
#define gcd(a,b) __gcd(a,b)
#define mem(x,n) memset(x,n,sizeof(x))
#define endl "\n"
using namespace std;
template <int POS, class TUPLE> void deploy(std::ostream &os, const TUPLE &tuple){}
template <int POS, class TUPLE, class H, class ...Ts> void deploy(std::ostream &os, const TUPLE &t){ os << (POS == 0 ? "" : ", ") << get<POS>(t); deploy<POS + 1, TUPLE, Ts...>(os, t); }
template <class T,class U> std::ostream& operator<<(std::ostream &os, std::pair<T,U> &p){ os << "(" << p.first <<", " << p.second <<")";return os; }
template <class T> std::ostream& operator<<(std::ostream &os, std::vector<T> &v){ int remain = v.size(); os << "{"; for(auto e: v) os << e << (--remain == 0 ? "}" : ", "); return os; }
template <class T> std::ostream& operator<<(std::ostream &os, std::set<T> &v){ int remain = v.size(); os << "{"; for(auto e: v) os << e << (--remain == 0 ? "}" : ", "); return os; }
template <class T, class K> std::ostream& operator<<(std::ostream &os, std::map<T, K> &mp){ int remain = mp.size(); os << "{"; for(auto e: mp) os << "(" << e.first << " -> " << e.second << ")" << (--remain == 0 ? "}" : ", "); return os; }
#define DEBUG1(var0) { std::cerr << (#var0) << "=" << (var0) << endl; }
#define DEBUG2(var0, var1) { std::cerr << (#var0) << "=" << (var0) << ", ";DEBUG1(var1); }
#define DEBUG3(var0, var1, var2) { std::cerr << (#var0) << "=" << (var0) << ", ";DEBUG2(var1,var2); }
#define DEBUG4(var0, var1, var2, var3) { std::cerr << (#var0) << "=" << (var0) << ", ";DEBUG3(var1,var2,var3); }
using ll = long long;


int main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << N * (N+1) / 2 << endl;
  
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:38:11: error: 'N' was not declared in this scope
   38 |   cout << N * (N+1) / 2 << endl;
      |           ^
Language: C++

#include <iostream>
int main() {
int n;
std::cin>>n;
std::cout<<n * (n+1) /2 <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    5 | std::cout<<n * (n+1) /2 <<endl;
      |                           ^~~~
      |                           std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
int main() {
int n;
cin>>n;
cout<<n * (n+1) /2 <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 | cin>>n;
      | ^~~
      | std::cin
In file included 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:5:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 | cout<<n * (n+1) /2 <<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:5:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    5 | cout<<n * (n+1) /2 <<endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

import java.util.Scanner;

public class ABC43_A{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		System.out.println(n*(n+1)/2);
	}
}

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

#include <stdio.h>

int main(){
	int num_children
	scanf("%d", &num_children);
	int count = num_children;
	int sum = 0;
	while(count > 0){
		sum += count--;
	}
	printf("%d",sum);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
    5 |         scanf("%d", &num_children);
      |         ^~~~~
main.c:5:22: error: 'num_children' undeclared (first use in this function)
    5 |         scanf("%d", &num_children);
      |                      ^~~~~~~~~~~~
main.c:5:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

int main()
{

	cin >> N;

	cout << N * (N+1) / 2 << endl;




}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> N;
      |         ^~~
a.cc:4:16: error: 'N' was not declared in this scope
    4 |         cin >> N;
      |                ^
a.cc:6:9: error: 'cout' was not declared in this scope
    6 |         cout << N * (N+1) / 2 << endl;
      |         ^~~~
a.cc:6:34: error: 'endl' was not declared in this scope
    6 |         cout << N * (N+1) / 2 << endl;
      |                                  ^~~~
Language: Java

package abc_043;

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

public class Main4 {
	// 連続した部分文字列がkの長さをもつとすると
	// aa
	// a*a
	// のどちらかしか存在しない。このパターンを使わないということはa**a**q...と繰り返すことになるがこの方法では条件をみたすことはないからである
	// テスト
	// asdfghjklaa : 最後だけ
	// faewasdfala
	// qwertyuioaa
	// aaqwertyuiop:最初
	static String line;

	static int N;
	public static void main(String args[]) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		line = br.readLine();
		String text[] = line.split("");
		N = text.length;
		method(text);
	}

	static void method(String text[]) {

		for (int i = 0; i < text.length - 2; i++) {
			if (text[i].equals(text[i + 2])) {
				i++;
				System.out.println(i + " " + (i + 2));
				return;
			}
		}

		for (int i = 0; i < text.length - 1; i++) {
			if (text[i].equals(text[i + 1])) {
				i++;
				System.out.println(i + " " + (i + 1));
				return;
			}
		}

		System.out.println("-1 -1");
	}
}


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

#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <list>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(d) string(1,d)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main() {
  ll n;
  cin>>n;
  cout << n*(n+1)/2 << endk;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:24: error: 'endk' was not declared in this scope
   42 |   cout << n*(n+1)/2 << endk;
      |                        ^~~~
Language: C++

#include <iostream>

int main() {
int a;
cin >> a;
cout << a * (a -1 ) /2;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin >> a;
      | ^~~
      | std::cin
In file included 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:6:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 | cout << a * (a -1 ) /2;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

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

int main() {
	char s[11];
	char r[11];
	//char buf[64];
	int i,j,k;
	scanf_s("%s", s, 11);

	for (i = 0, j=0; s[i] != '\0'; i++) {
		//fgets(buf, 64, stdin);
		if (s[i] == 'B') {
			j--;
			if (j < 0) j = 0;
		}
		else {
			r[j] = s[i];
			j++;
		}
	}
	for (k = 0, r[j] = '\0'; k < j; k++) printf("%c", r[k]);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    9 |         scanf_s("%s", s, 11);
      |         ^~~~~~~
      |         scanf
Language: C++

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




int main() {
	char s[11];
	char r[11];
	char buf[64];
	int i,n,j,dummy,k;
	scanf_s("%s", s, 11);
	for (n = 0; s[n] != '\0'; n++);

	for (i = 0, j=0; s[i] != '\0'; i++) {
		fgets(buf, 64, stdin);
		if (s[i] == 'B') {
			j--;
		}
		else {
			r[j] = s[i];
			j++;
		}
		for (k = 0, r[j] = '\0'; k < j; k++) printf("%c", r[k]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   12 |         scanf_s("%s", s, 11);
      |         ^~~~~~~
      |         scanf
Language: C

#include <stdio.h>
 
int main{
    
    int N;
 
    printf("子供の人数=");
    scanf("%d",&N);
 
    printf("必要なキャンディの個数は%d個です",(N+1)*N/2);
 
    return 0;
}

Compiler output:
main.c:3:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    3 | int main{
      |         ^
Language: C

#include stdio.h

int main{
    
    int N;

    printf("子供の人数=");
    scanf("%d",&N);

    printf("必要なキャンディの個数は%d個です",(N+1)*N/2);

    return 0;
}

Compiler output:
main.c:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include stdio.h
      |          ^~~~~
main.c:3:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    3 | int main{
      |         ^
Language: C

#include<stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{

        char S[11];
        char S2[11];
        int i;
        int j;
        int len;

        scanf("%s",S);

        len = strlen( s );
        j = 0;
        for (i=0; i < len; i++) {
           if (S[i]  ==  0) {
             j = j + 1;
             S2[j - 1] = 0;
           }
           if  ( S[i]  ==  1) {
             j = j + 1;
             S2[j - 1] = 1;
           }

           if  ( S[i]  ==  'B') {
             j = j - 1;
           }

        printf("%s\n",S2);
        
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:23: error: 's' undeclared (first use in this function)
   15 |         len = strlen( s );
      |                       ^
main.c:15:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:1: error: expected declaration or statement at end of input
   34 | }
      | ^
Language: C

#include<stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{

        int n;
        int i;
        int sum;

        scanf("%d",&n);

        for (i=0; i < n; i++) {
           j = i + 1;
           sum = sum + 1;
        }
 
        printf("%d\n",sum);
        
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:12: error: 'j' undeclared (first use in this function)
   14 |            j = i + 1;
      |            ^
main.c:14:12: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util.Scanner;

/**
 * Created by wild on 16/08/13.
 */
public class one {
    public static void main (String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int result = 0;
        for (int i = 0; i < n; i++){
            result += 1 + i;
        }
        System.out.println(result);
    }
}

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

using System;

class A {
	static void Main() {
		var n = int.Parse(Console.ReadLine());
		var a = 0;
		for(int i = 1;i <= n;i++) {
			a += i;
		}
		Console.WriteLine(a);
	}
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:12:2: error: expected ';' after class definition
   12 | }
      |  ^
      |  ;
a.cc: In static member function 'static void A::Main()':
a.cc:5:17: error: 'var' was not declared in this scope
    5 |                 var n = int.Parse(Console.ReadLine());
      |                 ^~~
a.cc:6:21: error: expected ';' before 'a'
    6 |                 var a = 0;
      |                     ^
a.cc:7:36: error: 'n' was not declared in this scope
    7 |                 for(int i = 1;i <= n;i++) {
      |                                    ^
a.cc:8:25: error: 'a' was not declared in this scope
    8 |                         a += i;
      |                         ^
a.cc:10:17: error: 'Console' was not declared in this scope
   10 |                 Console.WriteLine(a);
      |                 ^~~~~~~
a.cc:10:35: error: 'a' was not declared in this scope
   10 |                 Console.WriteLine(a);
      |                                   ^
Language: Java

package vtor;

import java.util.*;

public class First {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	
		int N = sc.nextInt();
		
		sc.close();
		
		long value = (N * N + N)/2;
		
		System.out.println(value);
	}
}


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

import java.util.*;
import java.io.*;

public class Main {

    int[] a;

    void solve() {
	int N = sc.nextInt();
	int ans;
	for (int i = 1; i < N+1; i++) {
	    ans += i;
	}

	System.out.println(ans);

    }

    void print(int[] a) {
	out.print(a[0]);
	for (int i = 1; i < a.length; i++) out.print(" " + a[i]);
	out.println();
    }

    public static void main(String[] args) throws Exception {
	new Main().run();
    }

    MyScanner sc = null;
    PrintWriter out = null;
    public void run() throws Exception {
	sc = new MyScanner(System.in);
	out = new PrintWriter(System.out);
	for (;sc.hasNext();) {
	    solve();
	    out.flush();
	}
	out.close();
    }

    class MyScanner {
	String line;
	BufferedReader reader;
	StringTokenizer tokenizer;

	public MyScanner(InputStream stream) {
	    reader = new BufferedReader(new InputStreamReader(stream));
	    tokenizer = null;
	}
	public void eat() {
	    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
		try {
		    line = reader.readLine();
		    if (line == null) {
			tokenizer = null;
			return;
		    }
		    tokenizer = new StringTokenizer(line);
		} catch (IOException e) {
		    throw new RuntimeException(e);
		}
	    }
	}
	public String next() {
	    eat();
	    return tokenizer.nextToken();
	}
	public String nextLine() {
	    try {
		return reader.readLine();
	    } catch (IOException e) {
		throw new RuntimeException(e);
	    }
	}
	public boolean hasNext() {
	    eat();
	    return (tokenizer != null && tokenizer.hasMoreElements());
	}
	public int nextInt() {
	    return Integer.parseInt(next());
	}
	public long nextLong() {
	    return Long.parseLong(next());
	}
	public double nextDouble() {
	    return Double.parseDouble(next());
	}
	public int[] nextIntArray(int n) {
	    int[] a = new int[n];
	    for (int i = 0; i < n; i++) a[i] = nextInt();
	    return a;
	}
    }
}


Compiler output:
Main.java:12: error: variable ans might not have been initialized
	    ans += i;
	    ^
Main.java:15: error: variable ans might not have been initialized
	System.out.println(ans);
	                   ^
2 errors
Language: C++

#include<stdio.h>

int main() {
	int n,i,sum=0;
	scanf_s("%d",&n);
	for (i = 1; i <= n; i++) sum += i;
	printf("%d\n",sum);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    5 |         scanf_s("%d",&n);
      |         ^~~~~~~
      |         scanf
Language: Java

/**
 * Created by abhishek on 8/4/2016.
 */
import java.util.*;
import java.io.*;
public class C {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        System.out.println(n*(n + 1)/2);
    }
}


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

#include <iostream>
using namespace std;

int main(){

int n;
cin >> n;

cout << n*(n+1)/2 << endl;

return;

Compiler output:
a.cc: In function 'int main()':
a.cc:11:1: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 | return;
      | ^~~~~~
a.cc:11:8: error: expected '}' at end of input
   11 | return;
      |        ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: Java

import java.util.*;
import java.io.*;
import java.math.*;
public class Unhappy_hacking {

	public static void main(String[] args) {
		FastScanner I=new FastScanner();
		Output O=new Output();
		String s=I.next();
		Stack<Character> cur=new Stack<Character>();
		Stack<Character> ans=new Stack<Character>();
		for(int i=0;i<s.length();i++) {
			if(s.charAt(i)=='1') cur.push('1');
			else if(s.charAt(i)=='0') cur.push('0');
			else if(s.charAt(i)=='B' && cur.size()>0) cur.pop();
		}
		while(!cur.empty()) {
			ans.add(cur.pop());
		}
		while(!ans.empty()) {
			O.p(ans.pop());
		}
		
		System.out.println();
	}
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		int nextInt() {return Integer.parseInt(next());}
		long nextLong() {return Long.parseLong(next());};
	}

	static class Output{
		PrintWriter w=new PrintWriter(System.out);
		void pln(int x) {w.println(x); w.flush();}
		void pln(long x) {w.println(x); w.flush();}
		void pln(String x) {w.println(x); w.flush();}
		void pln(char x) {w.println(x); w.flush();}
		void pln(StringBuilder x) {w.println(x); w.flush();}
		void p(int x) {w.print(x);w.flush();}
		void p(long x) {w.print(x);w.flush();}
		void p(String x) {w.print(x);w.flush();}
		void p(char x) {w.print(x);w.flush();}
		void p(StringBuilder x) {w.print(x);w.flush();}
	}
		
}


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

s = str(input())
ans = []
for i in range(len(s)):
    if s[i] == "B":
        if len(ans) != 0: ans.pop()
    else : ans.append(s[i])
print(''.join(ans))

Compiler output:
a.cc:7:7: error: empty character constant
    7 | print(''.join(ans))
      |       ^~
a.cc:1:1: error: 's' does not name a type
    1 | s = str(input())
      | ^
Language: C++

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


Compiler output:
a.cc:11:16: error: empty character constant
   11 |       s[i-1] = '';
      |                ^~
a.cc: In function 'int main()':
a.cc:8:16: error: 'B' was not declared in this scope
    8 |     if(s[i] == B){
      |                ^
a.cc:9:12: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
    9 |     s[i] = "";
      |            ^~
      |            |
      |            const char*
Language: C++

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

Compiler output:
a.cc:9:12: error: empty character constant
    9 |     s[i] = '';
      |            ^~
a.cc:11:16: error: empty character constant
   11 |       s[i-1] = '';
      |                ^~
a.cc: In function 'int main()':
a.cc:8:16: error: 'B' was not declared in this scope
    8 |     if(s[i] == B){
      |                ^
Language: Java


import java.util.*;

public class Main{
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String ans = "";
        for(int i = 0; i < s.length; i++){
            if(s.charAt(i) == '0' || s.charAt(i) == '1'){
                ans += s.charAt(i);
            }else{
                ans.substring(0, ans.length() - 1);
            }
        }
        System.out.println(ans);
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
        for(int i = 0; i < s.length; i++){
                            ^
  symbol:   variable length
  location: variable s of type String
1 error
Language: Java


import java.util.*;

public class Main{
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String ans = "";
        for(int i = 0; i < sa.length; i++){
            if(s.charAt(i) == "0" || s.charAt(i) == "1"){
                ans += s.charAt(i);
            }else{
                ans.substring(0, ans.length() - 1);
            }
        }
        System.out.println(ans);
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
        for(int i = 0; i < sa.length; i++){
                           ^
  symbol:   variable sa
  location: class Main
Main.java:10: error: bad operand types for binary operator '=='
            if(s.charAt(i) == "0" || s.charAt(i) == "1"){
                           ^
  first type:  char
  second type: String
Main.java:10: error: bad operand types for binary operator '=='
            if(s.charAt(i) == "0" || s.charAt(i) == "1"){
                                                 ^
  first type:  char
  second type: String
3 errors
Language: Java


import java.util.*;

public class Main{
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] sa = s.split("");
        String ans = "";
        for(int i = 0; i < sa.length; i++){
            if(sa[i] == "0" || sa[i] == "1"){
                ans += sa[i];
            }else{
                ans.substring(0, end - 1);
            }
        }
        System.out.println(ans);
    }
}

Compiler output:
Main.java:14: error: cannot find symbol
                ans.substring(0, end - 1);
                                 ^
  symbol:   variable end
  location: class Main
1 error
Language: Java


import java.util.*;

public class Main{
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] sa = s.split("");
        StringBuilder ans = new StringBuilder();
        for(int i = 0; i < sa.length; i++){
            if(sa[i] == '0' || sa[i] == '1'){
                ans.append(sa[i]);
            }else{
                ans.setLength(ans.length() - 1);
            }
        }
        System.out.println(ans);
    }
}

Compiler output:
Main.java:11: error: bad operand types for binary operator '=='
            if(sa[i] == '0' || sa[i] == '1'){
                     ^
  first type:  String
  second type: char
Main.java:11: error: bad operand types for binary operator '=='
            if(sa[i] == '0' || sa[i] == '1'){
                                     ^
  first type:  String
  second type: char
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    string in,out;
    cin>>in;
    for(int i=0;i<in.size();i++){
        if(in.at(i)=="0"){
            out.push_back(i);
            out.at(i)="0";
        }else if(in.at(i)=="1"){
            out.push_back(i);
            out.at(i)="1";
        }else{
            out.pull_back(i);
        }
    }
    cout<<out<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |         if(in.at(i)=="0"){
      |            ~~~~~~~~^~~~~
a.cc:9:23: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
    9 |             out.at(i)="0";
      |                       ^~~
      |                       |
      |                       const char*
a.cc:10:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         }else if(in.at(i)=="1"){
      |                  ~~~~~~~~^~~~~
a.cc:12:23: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   12 |             out.at(i)="1";
      |                       ^~~
      |                       |
      |                       const char*
a.cc:14:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pull_back'; did you mean 'push_back'?
   14 |             out.pull_back(i);
      |                 ^~~~~~~~~
      |                 push_back
Language: Java

import java.util.*;
import java.util.stream.Collectors;

/**
 * ABC043 B
 *
 * @date 2020.08.22
 * @author 焼き鮭 <yaki-shake@up-tri.me>
 */

public class App {
  Scanner sc;

  public static void main(String[] args) {
    new App().execute();
  }

  public void execute() {
    this.sc = new Scanner(System.in);
    String commands = this.sc.next();
    String[] keys = commands.split("");
    ArrayList<String> output = new ArrayList<String>();
    for (String key : keys) {
      if (key.equals("B")) {
        if (0 < output.size()) {
          output.remove(output.size() - 1);
        }
      } else {
        output.add(key);
      }
    }

    System.out.println(output.stream().collect(Collectors.joining("")));
  }
}


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

import java.util.*;
import java.util.stream.Collectors;

/**
 * ABC043 B
 *
 * @date 2020.08.22
 * @author 焼き鮭 <yaki-shake@up-tri.me>
 */

public class B {
  Scanner sc;

  public static void main(String[] args) {
    new B().execute();
  }

  public void execute() {
    this.sc = new Scanner(System.in);
    String commands = this.sc.next();
    String[] keys = commands.split("");
    ArrayList<String> output = new ArrayList<String>();
    for (String key : keys) {
      if (key.equals("B")) {
        if (0 < output.size()) {
          output.remove(output.size() - 1);
        }
      } else {
        output.add(key);
      }
    }

    System.out.println(output.stream().collect(Collectors.joining("")));
  }
}


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

#include <stdio.h>

int main() {
	int count = 0;
	char Zx[14], Yz[14] = {};
	scanf("%s", &Zx);
	
	for (int u = 0; Zx[u] != '\0'; u++) {
		if (Zx[u] == '0') {
			Yz[count] = '0';
			count++;
		}
		else if (Zx[u] == '1') {
			Yz[count] = '1';
			count++;
		}
		else if (count != 0) {
            if (Xz[u] == 'B') {
                Yz[count - 1] = '0';
                count -= 1;
            }
    	}
	}
	Yz[count] = '\0';
    printf("%s", Yz);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'Xz' was not declared in this scope; did you mean 'Yz'?
   18 |             if (Xz[u] == 'B') {
      |                 ^~
      |                 Yz
Language: C++

#include <stdio.h>
#include <string.h>
int main() {
	char command[10+1];
	scanf("%s",&command);
	int len = strlen(command);
	char output[len+1];
	for (int i = 0, j = 0; i < len; i++,j++)
	{
		if (command[i] == '0')
		{
			output[j] = '0';
			output[j+1] = '\0';
		}
		else if (command[i] == '1')
		{
			output[j] = '1';
			output[j+1] = '\0';
		}
		else (command[i] == 'B')
		{
			if (output[j-1] != '\0')
			{
				output[--j] = '\0';
			}
		}
	}
	printf("%s\n",output);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:41: error: expected ';' before '{' token
   20 |                 else (command[i] == 'B')
      |                                         ^
      |                                         ;
   21 |                 {
      |                 ~
Language: C++

#include <stdio.h>
int main(){
char a[20],
char b[20];
scanf("%s",a);
int counter=0;
for (int i=0 ; a[i] != '\0';i++){
    if(a[i] == '0'){
        b[counter]='0';
        counter++;
    }
    else if(a[i] == '1'){
        b[counter]='1';
        counter++;
    }
    else if(counter != 0){
        if(a[i] == 'B'){
            b[counter - 1]='\0';
            counter=counter-2;
        }
        counter++;
    }
}
b[counter] = '\0';
printf("%s",b);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: expected unqualified-id before 'char'
    4 | char b[20];
      | ^~~~
a.cc:9:9: error: 'b' was not declared in this scope
    9 |         b[counter]='0';
      |         ^
a.cc:13:9: error: 'b' was not declared in this scope
   13 |         b[counter]='1';
      |         ^
a.cc:18:13: error: 'b' was not declared in this scope
   18 |             b[counter - 1]='\0';
      |             ^
a.cc:24:1: error: 'b' was not declared in this scope
   24 | b[counter] = '\0';
      | ^
Language: C++

#include <stdio.h>
int main(){
char a[20],b[20];
scanf("%s",a);
int counter=0;
for (int i=0;a[i]!='\0';i++){
	if(a[i]=='0'){
		b[couter]='0';
		counter++;
	}
	else if(a[i]=='1'){
		b[counter]='1';
		counter++;
	}
	else if(counter!=0){
		if(a[i]=='B'){
			b[counter-1]='\0';
			counter=counter-2;
		}
		counter++;
	}
}
b[counter]='\0';
printf("%s",b);
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 'couter' was not declared in this scope; did you mean 'counter'?
    8 |                 b[couter]='0';
      |                   ^~~~~~
      |                   counter
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> vi;

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

	string s, f="";
	cin >> s;
	int n = s.length();
	for(int i=0; i<n; i++) {
		if(s[i] == 'B') {
			s[i] = '9';
			s[i-1] = '9';
		}
	}
	for(int i=0; i<n; i++) {
		if (s[i] != '9') {
			f+= s[i];
			}
	}
	if(f.legth() > 0) {
		cout << f;
	} else {
		cout << "(empty)";
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'legth'; did you mean 'length'?
   25 |         if(f.legth() > 0) {
      |              ^~~~~
      |              length
Language: C++

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

int main() {
    string s; cin >> s;
    stack <ll> st;
    rep(i, s.size()) {
        if (s.at(i) == '0') st.push(0);
        else if (s.at(i) == '1') st.push(1);
        else s.pop();
    }
    vector <ll> v;
    rep(i, st.size()) {
        v.push_back(st.top()); st.pop();
    }
    rep(i, v.size()) cout << v.at(v.size()-1-i) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
   14 |         else s.pop();
      |                ^~~
Language: C++

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

int main() {
  string s;cin>>s;string v="";
  for(int i=0;i<s.sise();i++){
    if(s[i]=='0'||s[i]=='1')v.push_back(s[i]);
    else if(s[i]=='B'){
      if(v.sise()==0)break;
      else v.erase(v.end());
    }
  }cout<<v<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sise'; did you mean 'size'?
    6 |   for(int i=0;i<s.sise();i++){
      |                   ^~~~
      |                   size
a.cc:9:12: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sise'; did you mean 'size'?
    9 |       if(v.sise()==0)break;
      |            ^~~~
      |            size
Language: C++

  vector<int> vec;
  int c = 0;
  rep(i, N) {
    if(str.at(i) == '0') {
      vec.push_back(0);
      c++;
    }
    if(str.at(i) == '1') {
      vec.push_back(1);
      c++;
    }
    if(str.at(i) == 'B') {
      if(c > 0) {
        c--;
        vec.pop_back();
      } 
    }
  }
  rep(i, vec.size()) {
    cout << vec.at(i);
  }
}

Compiler output:
a.cc:1:3: error: 'vector' does not name a type
    1 |   vector<int> vec;
      |   ^~~~~~
a.cc:3:6: error: expected constructor, destructor, or type conversion before '(' token
    3 |   rep(i, N) {
      |      ^
a.cc:19:6: error: expected constructor, destructor, or type conversion before '(' token
   19 |   rep(i, vec.size()) {
      |      ^
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  string str;
  cin >> str;
  int N = str.size();
  vector<int> vec;
  rep(i, N) {
    if(str.at(i) == '0') {
      vec.push_back(0);
    }
    if(str.at(i) == '1') {
      vec.push_back(1);
    }
    if(str.at(i) == 'B') {
      vec.pop_back;
    }
  }
  rep(i, vec.size()) {
    cout << vec.at(i);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = int; _Alloc = std::allocator<int>]'
   19 |       vec.pop_back;
      |       ~~~~^~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1324:7: note: declared here
 1324 |       pop_back() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  string str;
  cin >> str;
  int N = str.size();
  vector<int> vec;
  rep(i, N) {
    if(str.at(i) == '0') {
      vec.push_back(0);
    }
    if(str.at(i) == '1') {
      vec.puch_back(1);
    }
    if(str.at(i) == 'B') {
      vec.pop_beck;
    }
  }
  rep(i, vec.size()) {
    cout << vec.at(i);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: 'class std::vector<int>' has no member named 'puch_back'; did you mean 'push_back'?
   16 |       vec.puch_back(1);
      |           ^~~~~~~~~
      |           push_back
a.cc:19:11: error: 'class std::vector<int>' has no member named 'pop_beck'; did you mean 'pop_back'?
   19 |       vec.pop_beck;
      |           ^~~~~~~~
      |           pop_back
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		String s = scn.next();
		String[] list = s.split("");
      	String ans = "";
      	if(s.length()==1){
          ans = s;
        }else{
          for(int i=1; i<s.length(); i++){
			if(list[i].equals("B")){
              list[i-1]="2";
              list[i]="2";
            }
		  }
          if(list[0].equals("B")) list[0]=2;
          for(int i=0; i<s.length(); i++){
            if(!(list[i].equals("2"))) ans+=list[i];
          }
          
        }
      	System.out.println(ans);
	}
}


Compiler output:
Main.java:18: error: incompatible types: int cannot be converted to String
          if(list[0].equals("B")) list[0]=2;
                                          ^
1 error
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
using ull = unsigned long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

template<class T>
bool ChangeMax(T&a,const T&b){
  if(a >= b) return false;
  a = b;    return true;
}

template<class T>
bool ChangeMin(T&a,const T&b){
  if(a <= b) return false;
  a = b;    return true;  
}

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int f(int n){
  return (n*n+4)/8;
}

int main(){
  deque<char> dq;
  string s; cin >> s;
  for(int i = 0; i < (int)s.size(); ++i){
    if(s[i] == '0' || s[i] == '1'){
      dq.push_back(s[i]);
    } else if(!st.empty()){
      dq.pop_back();
    }
  }
  for(auto e:dq)cout << e;
  cout << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:49:16: error: 'st' was not declared in this scope; did you mean 's'?
   49 |     } else if(!st.empty()){
      |                ^~
      |                s
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    7 |   string c = s.at(0)
      |              ~~~~^~~
a.cc:8:3: error: expected ',' or ';' before 'for'
    8 |   for (int i = 1; i < S; i++) {
      |   ^~~
a.cc:8:19: error: 'i' was not declared in this scope
    8 |   for (int i = 1; i < S; i++) {
      |                   ^
Language: C

#include <stdio.h>

int main () {
	char str[15];
	char modstr[15];
	int length = 0;
	(scanf("%s", str);
	for (int i = 0; str[i] != '\0'; i++) {
		length++;
	}
	int j = 0;
	for (int i = 0; i < length; i++) {
		if (str[i] == '0') {
			modstr[j] = '0';				
			j++;
		}
		else if (str[i] == '1') {
			modstr[i] = '1';
			j++; 
		}
		else if (str[i] == 'B') {
			if (j != 0) {
				j--;
				modstr[j] = '\0';
			}
		}
	}
	printf("%s", modstr);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:26: error: expected ')' before ';' token
    7 |         (scanf("%s", str);
      |         ~                ^
      |                          )
main.c:30:18: error: expected ';' before '}' token
   30 |         return 0;
      |                  ^
      |                  ;
   31 | }
      | ~
Language: Java



import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String s = input.nextLine();
        Queue<String> q0 = new LinkedList<>();
        Queue<String> q1 = new LinkedList<>();
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                q0.add("0");
            } else if (s.charAt(i) == '1') {
                q1.add("1");
            } else {
                if (!q1.isEmpty()) {
                    q1.remove();
                } else if (q1.isEmpty() && (!q0.isEmpty())) {
                    q0.remove();
                }
            }
        }
        if (!q0.isEmpty()) {
            for (String a : q0) {
                System.out.print(a);
            }
        }
        if (!q1.isEmpty()) {
            for (String a : q1) {
                System.out.print(a);
            }
        }
        
        System.out.println();

    }

}
}


Compiler output:
Main.java:41: error: class, interface, enum, or record expected
}
^
1 error