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

public class Main{
	
	public static void main(String[] args) throws IOException{
		InputStreamReader inputStreamReader = new InputStreamReader(System.in);
		BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
		StringBuilder stringBuilder = new StringBuilder();

		while(true){
			String dataSet = bufferedReader.readLine();
			if(dataSet.length()==0) break;
			String[] dataList = dataSet.split(" ");
			int x = Integer.parseInt(dataList[0]);
			int y = Integer.parseInt(dataList[1]);
			if(x>y){
				stringBuilder.append(gcd(x, y) + "\n");	
			}else
			stringBuilder.append(gcd(y, x) + "\n");
			
		}
		System.out.print(stringBuilder);
	}
	
	static int gcd(int x, int y){
		if(y==0){
			return x;
		}else{
			return gcd(y, x%y);
		}
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
	public static void main(String[] args) throws IOException{
	                                              ^
  symbol:   class IOException
  location: class Main
Main.java:4: error: cannot find symbol
		InputStreamReader inputStreamReader = new InputStreamReader(System.in);
		^
  symbol:   class InputStreamReader
  location: class Main
Main.java:4: error: cannot find symbol
		InputStreamReader inputStreamReader = new InputStreamReader(System.in);
		                                          ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:5: error: cannot find symbol
		BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:5: error: cannot find symbol
		BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
		                                    ^
  symbol:   class BufferedReader
  location: class Main
5 errors
Language: Java


class Main {
    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            String line = br.readLine();
            System.out.println(getCubicOf(line));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * @param line
     *            ??´??°x?????\???
     * @return x???3???
     */
    private static long getCubicOf(String line) {
        long x = Long.parseLong(line);
        return (long)Math.pow(x, 3);
    }
}

Compiler output:
Main.java:5: error: cannot find symbol
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            ^
  symbol:   class BufferedReader
  location: class Main
Main.java:5: error: cannot find symbol
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                                    ^
  symbol:   class BufferedReader
  location: class Main
Main.java:5: error: cannot find symbol
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                                                       ^
  symbol:   class InputStreamReader
  location: class Main
3 errors
Language: Java

class Main {
    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String line = br.readLine();
            StringTokenizer st = new StringTokenizer(line, " ");
            while(st.hasMoreTokens()) {
            	int x = Integer.parseInt(st.nextToken());
                int y = Integer.parseInt(st.nextToken());

            	if(x < y) {
            		x = x + y;
                	y = x - y;
                	x = x - y;

            	}

            	while(y > 0) {
            		int r = x % y;
            		x = y;
            		y = r;
            	}
            	System.out.println(x);
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Compiler output:
Main.java:4: error: cannot find symbol
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            ^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                                    ^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                                                       ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:6: error: cannot find symbol
            StringTokenizer st = new StringTokenizer(line, " ");
            ^
  symbol:   class StringTokenizer
  location: class Main
Main.java:6: error: cannot find symbol
            StringTokenizer st = new StringTokenizer(line, " ");
                                     ^
  symbol:   class StringTokenizer
  location: class Main
5 errors
Language: Java

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

class Main {
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));// ??\????????????????????????
			String line;
			int a, b, temp;
			int x = 0;
			while ((line = br.readLine()) != null) {
				StringTokenizer st = new StringTokenizer(line, " ");
				a = Integer.parseInt(st.nextToken());
				b = Integer.parseInt(st.nextToken());

				if (a < b) {
					temp = a;
					a = b;
					b = temp;
				}
				while (b != 0) {
					x = a % b;
					a = b;
					b = x;
				}
			}
			System.out.println(a);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

Compiler output:
Main.java:28: error: variable a might not have been initialized
			System.out.println(a);
			                   ^
1 error
Language: Java

import java.util.*;
import java.math.*;
public class GCD {
        static Scanner sc = new Scanner(System.in);
        static BigInteger a,b;
        public static void main(String[] args) {
                while(read()){
                        solve();
                }
        }
        static boolean read(){
                if(!sc.hasNext())
                        return false;
                a = sc.nextBigInteger(); b = sc.nextBigInteger();
                return true;
        }
        static void solve(){
                System.out.println(a.gcd(b));
        }
 
}

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

import java.util.Scanner;


public class Main {
	
	public static int gcd(int a, int b){
		int r;
		if(b > a){
			int t = a;
			a = b;
			b = t;
		}
		
		while((r = a % b) != 0){
			a = b;
			b = r;
		}
		
		return b;
	}
	
	public static void main(String[] args) {a
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			System.out.println(gcd(sc.nextInt(), sc.nextInt()));
		}

	}

}

Compiler output:
Main.java:23: error: ';' expected
		Scanner sc = new Scanner(System.in);
		       ^
1 error
Language: C

#include <cstdio>
#include <algorithm>
using namespace std;

int main()
{
	int m,n;
	
	scanf("%d %d", &m, &n);
	if(m < n) swap(m,n);
	
	while(n != 0){
		int t=n;
		n = m%n;
		m = t;
	}
	
	printf("%d\n", m);
	return (0);
}

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

#include <stdio.h>

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

int main(void)
{
	int a, b;
	
	while (scanf("%d %d", &a, &b) != EOF){
		printf("%d\n", gcd(a, b);
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:41: error: expected ')' before ';' token
   14 |                 printf("%d\n", gcd(a, b);
      |                       ~                 ^
      |                                         )
main.c:14:42: error: expected ';' before '}' token
   14 |                 printf("%d\n", gcd(a, b);
      |                                          ^
      |                                          ;
   15 |         }
      |         ~
Language: C

include<stdio.h>

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

}

int main()
{
int a,b;
while(scanf("%d%d",&a,&b)!=EOF){
printf("%d\n",gcd(a,b));
}

    return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:13:7: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   13 | while(scanf("%d%d",&a,&b)!=EOF){
      |       ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:13:7: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   13 | while(scanf("%d%d",&a,&b)!=EOF){
      |       ^~~~~
main.c:13:7: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:28: error: 'EOF' undeclared (first use in this function)
   13 | while(scanf("%d%d",&a,&b)!=EOF){
      |                            ^~~
main.c:13:28: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:13:28: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   14 | printf("%d\n",gcd(a,b));
      | ^~~~~~
main.c:14:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:15: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration]
   14 | printf("%d\n",gcd(a,b));
      |               ^~~
Language: C

include<stdio.h>

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

}

int main(void)
{
int a,b;

while(scanf("%d%d",&a,&b)!=EOF){
printf("%d\n",gcd(a,b));
}

    return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:14:7: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   14 | while(scanf("%d%d",&a,&b)!=EOF){
      |       ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:14:7: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   14 | while(scanf("%d%d",&a,&b)!=EOF){
      |       ^~~~~
main.c:14:7: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:14:28: error: 'EOF' undeclared (first use in this function)
   14 | while(scanf("%d%d",&a,&b)!=EOF){
      |                            ^~~
main.c:14:28: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:14:28: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   15 | printf("%d\n",gcd(a,b));
      | ^~~~~~
main.c:15:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:15: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration]
   15 | printf("%d\n",gcd(a,b));
      |               ^~~
Language: C


}#include<stdio.h>
int main()
{
    int a,b,c;
    while(scanf("%d %d",&a,&b)!=EOF)
    {
        while(c=a%b)
        {
            a=b;
            b=c;
        }
        printf("%d\n",b);
        }
        return 0;
}

Compiler output:
main.c:2:1: error: expected identifier or '(' before '}' token
    2 | }#include<stdio.h>
      | ^
main.c:2:2: error: stray '#' in program
    2 | }#include<stdio.h>
      |  ^
main.c:2:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 | }#include<stdio.h>
      |          ^
Language: C


}#include<stdio.h>
int main()
{
    int a,b,c;
    while(scanf("%d %d",&a,&b)!=EOF)
    {
        while(c=a%b)
        {
            b=c;
        }
        printf("%d\n",b);
        }
        return 0;
}

Compiler output:
main.c:2:1: error: expected identifier or '(' before '}' token
    2 | }#include<stdio.h>
      | ^
main.c:2:2: error: stray '#' in program
    2 | }#include<stdio.h>
      |  ^
main.c:2:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 | }#include<stdio.h>
      |          ^
Language: C

#include<iostream>
using namespace std;

int gcd(int x, int y) {
	if (y == 0) return x;
	else return gcd(y, x % y);
}

int main(){
    int a, b;
    while( scanf("%d %d", &a, &b) != EOF ){
        cout<<gcd(a,b)<<endl;
    }
    return 0;
}

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

#include <stdio.h> 
long gcd_euclid(long m, long n) 
{ 
    long tmp; 
    while (n) { 
        temp = m % n; m = n; n = tmp;
        } return m; 
    
} int main(){ 
    long a, b; 
    long tmp; 
    long gcd; 
    while(scanf("%ld %ld", &a, &b)!=EOF){ 
        gcd = gcd_euclid(a, b); 
        temp = a / gcd;
        
        printf("%ld %ld\n", gcd, lcm); 
        
    } return 0; 
    
}


Compiler output:
main.c: In function 'gcd_euclid':
main.c:6:9: error: 'temp' undeclared (first use in this function); did you mean 'tmp'?
    6 |         temp = m % n; m = n; n = tmp;
      |         ^~~~
      |         tmp
main.c:6:9: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:15:9: error: 'temp' undeclared (first use in this function); did you mean 'tmp'?
   15 |         temp = a / gcd;
      |         ^~~~
      |         tmp
main.c:17:34: error: 'lcm' undeclared (first use in this function)
   17 |         printf("%ld %ld\n", gcd, lcm);
      |                                  ^~~
Language: C

using namespace std;

int main(void){
  int a,b,tmp;

  while(cin>>a>>b){
    if(a<b) swap(a,b);

    while(1){
      if(a%b==0) break;

      tmp = a%b;
      a = b;
      b = tmp;
    }
    cout<<b<<endl;
  }

  return 0;
}

Compiler output:
main.c:1:1: error: unknown type name 'using'
    1 | using namespace std;
      | ^~~~~
main.c:1:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    1 | using namespace std;
      |                 ^~~
main.c: In function 'main':
main.c:6:9: error: 'cin' undeclared (first use in this function)
    6 |   while(cin>>a>>b){
      |         ^~~
main.c:6:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:13: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
    7 |     if(a<b) swap(a,b);
      |             ^~~~
main.c:16:5: error: 'cout' undeclared (first use in this function)
   16 |     cout<<b<<endl;
      |     ^~~~
main.c:16:14: error: 'endl' undeclared (first use in this function)
   16 |     cout<<b<<endl;
      |              ^~~~
Language: C

include<stdio.h>
int main(){
  int x,y,c,h;

  while(scanf("%d%d",&x,&y)!=EOF)
    {
      while(y!=0)
	{
	  x=x%y;
	  h=x;
	  x=y;
	  y=h;
	}

      printf("%d\n",x);
    }    
  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",__gcd(a,b));}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",__gcd(a,b));}
      | ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:18: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",__gcd(a,b));}
      |                  ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",__gcd(a,b));}
main.c:1:18: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",__gcd(a,b));}
      |                  ^~~~~
main.c:1:18: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:38: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",__gcd(a,b));}
      |                                      ^~~~~~
main.c:1:38: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:38: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:38: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:52: error: implicit declaration of function '__gcd' [-Wimplicit-function-declaration]
    1 | main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",__gcd(a,b));}
      |                                                    ^~~~~
Language: C

//import java.io.*;
import java.util.*;
//import java.math.*;
public class Main {
 
    public static void main(String[] args) throws java.io.IOException{
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
        	System.out.println(gcd(scan.nextInt(),scan.nextInt()));
        }
    }
    public static int gcd(int a,int b){
    	if(b==0)return a;
    	return gcd(b,a%b);
    }
}

Compiler output:
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.*;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.*;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

#include<stdio.h>
main(){
  int n,m,i,r;
  while(scanf("%d %d",&n,&m)!=EOF){
  if(m<n){
    i=n;n=m;m=i;
  }
  while(1){
    if(n==0){
      printf("%d\n",m);
      break;
    }
    r=n;
    n=m%n;
    m=r;
  }
}
  return 0;
}

}
  return 0;
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c:21:1: error: expected identifier or '(' before '}' token
   21 | }
      | ^
main.c:22:3: error: expected identifier or '(' before 'return'
   22 |   return 0;
      |   ^~~~~~
main.c:23:1: error: expected identifier or '(' before '}' token
   23 | }
      | ^
Language: C++

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

int main(void){
	int a,b;
	whilecin>>a>>b)
	cout<<__gcd(a,b)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'whilecin' was not declared in this scope
    7 |         whilecin>>a>>b)
      |         ^~~~~~~~
Language: C++

#include <iostream>

int main(){

int x,y;

cin >> x >> y;

while(x != y){
if(x > y)x = x - y;
if(y > x)y = y - x;
}
cout << x;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | cin >> x >> y;
      | ^~~
      | 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:13:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 | cout << x;
      | ^~~~
      | 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>

int main(){
int x,y;

int byakko(int x, inty){
x > y ? return x % y : return y % x;
}

while(scanf("%d %d", &x, &y)){
cout << byakko(x, y) << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: 'inty' has not been declared
    6 | int byakko(int x, inty){
      |                   ^~~~
a.cc:6:24: error: a function-definition is not allowed here before '{' token
    6 | int byakko(int x, inty){
      |                        ^
a.cc:11:1: error: 'cout' was not declared in this scope
   11 | cout << byakko(x, y) << endl;
      | ^~~~
a.cc:11:9: error: 'byakko' was not declared in this scope
   11 | cout << byakko(x, y) << endl;
      |         ^~~~~~
a.cc:11:25: error: 'endl' was not declared in this scope
   11 | cout << byakko(x, y) << endl;
      |                         ^~~~
Language: C++

#include <stdio.h>

int main(){
int x,y;

int byakko(int x, inty){
if(x > y)
return x % y;
else
return y % x;

return x;
}

while(scanf("%d %d", &x, &y)){
cout << byakko(x, y) << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: 'inty' has not been declared
    6 | int byakko(int x, inty){
      |                   ^~~~
a.cc:6:24: error: a function-definition is not allowed here before '{' token
    6 | int byakko(int x, inty){
      |                        ^
a.cc:16:1: error: 'cout' was not declared in this scope
   16 | cout << byakko(x, y) << endl;
      | ^~~~
a.cc:16:9: error: 'byakko' was not declared in this scope
   16 | cout << byakko(x, y) << endl;
      |         ^~~~~~
a.cc:16:25: error: 'endl' was not declared in this scope
   16 | cout << byakko(x, y) << endl;
      |                         ^~~~
Language: C++

#include <stdio.h>

int main(){
int x,y;

while(cin >> x >> y){

while(x % y != 0){
if(x > y)
x = x % y;
}
cout << x << endl;
}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'cin' was not declared in this scope
    6 | while(cin >> x >> y){
      |       ^~~
a.cc:12:1: error: 'cout' was not declared in this scope
   12 | cout << x << endl;
      | ^~~~
a.cc:12:14: error: 'endl' was not declared in this scope
   12 | cout << x << endl;
      |              ^~~~
Language: C++

#include<bits/stdc++.h>
main(a,b){while(~scanf("%d%d",&a,&b)){printf("%d\n",std::__gcd(a,b));}}

Compiler output:
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
    2 | main(a,b){while(~scanf("%d%d",&a,&b)){printf("%d\n",std::__gcd(a,b));}}
      |     ^
Language: C++

#include<algorithm>
int a,b;main(){while(~scanf("%d%d",&a,&b);printf("%d\n",std::__gcd(a,b)));}}

Compiler output:
a.cc:2:9: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | int a,b;main(){while(~scanf("%d%d",&a,&b);printf("%d\n",std::__gcd(a,b)));}}
      |         ^~~~
a.cc: In function 'int main()':
a.cc:2:23: error: 'scanf' was not declared in this scope
    2 | int a,b;main(){while(~scanf("%d%d",&a,&b);printf("%d\n",std::__gcd(a,b)));}}
      |                       ^~~~~
a.cc:2:42: error: expected ')' before ';' token
    2 | int a,b;main(){while(~scanf("%d%d",&a,&b);printf("%d\n",std::__gcd(a,b)));}}
      |                     ~                    ^
      |                                          )
a.cc:2:43: error: 'printf' was not declared in this scope
    2 | int a,b;main(){while(~scanf("%d%d",&a,&b);printf("%d\n",std::__gcd(a,b)));}}
      |                                           ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include<algorithm>
  +++ |+#include <cstdio>
    2 | int a,b;main(){while(~scanf("%d%d",&a,&b);printf("%d\n",std::__gcd(a,b)));}}
a.cc: At global scope:
a.cc:2:76: error: expected declaration before '}' token
    2 | int a,b;main(){while(~scanf("%d%d",&a,&b);printf("%d\n",std::__gcd(a,b)));}}
      |                                                                            ^
Language: C++

#include "bits/stdc++"
using namespace std;

int main()
{
int a, b;
while (cin >> a >> b){
cout << max(a, b) - min(a, b) < endl;
}

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

#include <iostream>
#include<math.h>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<functional>
using namespace std;

int main()
{
    int a=0;b=0;
    while(cin >> a >> b){
    int c=0;

    if(a<b){
        swap(a,b);
    }
    while(b>0){
        c = a%b;
        a=b;
        b=c;
    }
    cout << a;
    cout << endl;
    }
}

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

#include<iostream>

using namespace std;
int euclid(int n, int m);

int main(){
  int n,m;
  while(cin>>n>>m){
    cout <<euclid(n,m<<endl;
  }
}

int euclid(int n,int m){
  if(n<m){
  int temp;
  temp=m;
  m=n;
  n=temp;
  }
  if(n%m==0){
    return m;
  }else{
    return euclid(m,n%m);
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    9 |     cout <<euclid(n,m<<endl;
      |                     ~^~~~~~
Language: C++

#include <stdio.h>
int gcd(int a,int b){
if(b==0)return a;
return gcd(b,a%b);
}
int main(){
int a,b;
while(scanf("%d%d",&a,&b)!=EOF){
printf("%d\n",gcd(a,b);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: expected ')' before ';' token
    9 | printf("%d\n",gcd(a,b);
      |       ~               ^
      |                       )
a.cc:10:2: error: expected '}' at end of input
   10 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include <stdio.h>
int gcd(int a,int b){
if(b==0)return a;
return gcd(b,a%b);
}
int main(){
int a,b;
while(scanf("%d%d",&a,&b)!=EOF){
printf("%d\n",gcd(a,b);
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: expected ')' before ';' token
    9 | printf("%d\n",gcd(a,b);
      |       ~               ^
      |                       )
Language: C++

package com.practice.takuya._1009;

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




public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String line = br.readLine();
			
			System.out.println(getGreatestCommonDivisor(line));
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private static int getGreatestCommonDivisor(String line) {
		
		String[] splitedArray = line.split(" ", 0);
		int x = Integer.valueOf(splitedArray[0]).intValue();
		int y = Integer.valueOf(splitedArray[1]).intValue();
		
		if(x < y) {
			swap(x, y);
		}
		
		if(y == 0) {
			return 0;
		}
		
		while(x % y != 0) {
			int temp = x % y;
			x = y;
			y = temp;
		}
		
		return y;
	}

	private static void swap(int x, int y) {
		int temp = x;
		y = x;
		x = temp;
	}
}



Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package com.practice.takuya._1009;
      | ^~~~~~~
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: expected unqualified-id before 'public'
    9 | public class Main {
      | ^~~~~~
Language: C++

int gcd(a,b){return b?gcd(b,a%b):a;}
main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",gcd(a,b));}

Compiler output:
a.cc:1:9: error: 'a' was not declared in this scope
    1 | int gcd(a,b){return b?gcd(b,a%b):a;}
      |         ^
a.cc:1:11: error: 'b' was not declared in this scope
    1 | int gcd(a,b){return b?gcd(b,a%b):a;}
      |           ^
a.cc:1:12: error: expression list treated as compound expression in initializer [-fpermissive]
    1 | int gcd(a,b){return b?gcd(b,a%b):a;}
      |            ^
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
    2 | main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",gcd(a,b));}
      |     ^
Language: C++

#include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int *a, *b, s, t, c;
	int p, q;
	a = &p;
	b = &q;
	while(cin >> p >> q){
		s = *a;
		t = *b;
		c = 1;
		for(int tmp = (*a > *b)? *b : *a, i = 2; i <= tmp; i++){
			while(s%i == 0 && t%i == 0){
				s /= i;
				t /= i;
				tmp /= i;
				c *= i;
			}
		}
		cout << c << " " << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include <cstdio>
int solve(int a, int b) {
	if (a%b==0) return a;
	return solve(b,a%b);
}
int main() {
	int a,b;
	while(scanf("%d %d",&a,&b)!=EOF) int res=solve(a,b); printf("%d\n",res);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:76: error: 'res' was not declared in this scope
    8 |         while(scanf("%d %d",&a,&b)!=EOF) int res=solve(a,b); printf("%d\n",res);
      |                                                                            ^~~
Language: C++

main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",__gcd(a,b));}

Compiler output:
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
    1 | main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",__gcd(a,b));}
      |     ^
Language: C++

#include <iostream>
ing main()
{
long int a, b, i, maks;
cin >> a >> b;
if (a > b) maks = a;
else maks = b;
for (i=2;i<=maks;i++)
if (maks % a == 0 && maks % b == 0)
{
cout << i << endl;
break;
}
return 0;
}

Compiler output:
a.cc:2:1: error: 'ing' does not name a type; did you mean 'int'?
    2 | ing main()
      | ^~~
      | int
Language: C++

#include <iostream>
using namespace std;
ing main()
{
long int a, b, i, maks;
cin >> a >> b;
if (a > b) maks = a;
else maks = b;
for (i=2;i<=maks;i++)
if (maks % a == 0 && maks % b == 0)
{
cout << i << endl;
break;
}
return 0;
}

Compiler output:
a.cc:3:1: error: 'ing' does not name a type; did you mean 'int'?
    3 | ing main()
      | ^~~
      | int
Language: C++

#include<iostream>
#include<stdio.h>
#include<cmath>
#define INF 9999999
using namespace std;
int a,b,c;
int main(){
	while(cin>>a>>b){
		while(b!=0){
			c=a%b;
			a=b;
			b=c;
		}
		cout<<a<<endl;
	}
	return 0

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

#include <iostream>
#include <vector>

using namespace std;

int get(int, int);

int main(int argc, char *argv[]) {
  int x, y;

  while (cin >> x >> y)
    cout << getLCM(x, y) << endl;
  return 0;
}

int get(int x, int y) {
  int tmp;

  if (x < y) {
    tmp = y;
    y = x;
    x = tmp;
  }
  while (x % y != 0) {
    tmp = x % y;
    x = y;
    y = tmp;
  }
  return y;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:12:13: error: 'getLCM' was not declared in this scope
   12 |     cout << getLCM(x, y) << endl;
      |             ^~~~~~
Language: C++

int gcd( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}

int main(int argc, const char * argv[])
{
    //std::cout << "Hello World\n";
    while(true){
        int n, m;
        std::cin >> n >> m;
        //std::cout << n << "," << m << "\n";
        std::cout << gcd(n, m) << "\n";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:21:14: error: 'cin' is not a member of 'std'
   21 |         std::cin >> n >> m;
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int gcd( int m, int n )
a.cc:23:14: error: 'cout' is not a member of 'std'
   23 |         std::cout << gcd(n, m) << "\n";
      |              ^~~~
a.cc:23:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

int gcd( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd

int main(int argc, const char * argv[])
{
    int n;
    while(cin >> n){
        //std::cout << n << "," << m << "\n";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:19:11: error: 'cin' was not declared in this scope
   19 |     while(cin >> n){
      |           ^~~
Language: C++

int gcd( int m, int n ){
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
};

int main(int argc, const char * argv[])
{
    int n, m;
    while(cin >> n >> m){
        //std::cout << n << "," << m << "\n";
        cout << gcd(m, n);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:18:11: error: 'cin' was not declared in this scope
   18 |     while(cin >> n >> m){
      |           ^~~
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout << gcd(m, n);
      |         ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b){
if(a<b)swap(a,b);
while(b){
a=a%b;
swap(a,b);
}
cout<<a<<endl;
}

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

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

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

	for(int a, b; cin >> a >> b;) {
		cout << __gcd(a, b) << endl;
	}

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: '__gcd' was not declared in this scope
   10 |                 cout << __gcd(a, b) << endl;
      |                         ^~~~~
Language: C

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

bool check(VI a, VI b){
    int n = a.size();
    int m = 7;
    REP(i,n) cout << a[i] << b[i] << endl;
    VVI dp(1<<n, VI(m));
    REP(i,n){
        dp[1<<i][b[i]] = 1;
        dp[1<<i][a[i]] = 1;
    }
    FOR(i,1,(1<<n)-1) REP(j,m){
        if (dp[i][j] == 0) continue;
        REP(k,n){
            if ((i >> k) & 1) continue;
            if (a[k] == j) dp[i | (1<<k)][b[k]] = 1;
            if (b[k] == j) dp[i | (1<<k)][a[k]] = 1;
        }
    }
    REP(j,m){
        if (dp[(1<<n)-1][j] == 1) return true;
    }
    return false;
}

int main(){
    int n;
    while (scanf("%d", &n)){
        VI a(n), b(n);
        REP(i,n){
            string x;
            cin >> x;
            a[i] = x[0] - '0';
            b[i] = x[1] - '0';
        }

        cout << (check(a, b) ? "Yes" : "No") << endl;
    }


    return 0;
}

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

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

int main()
{
	int n;
	while (cin >> n)
	{
		int a[7] = {0};
		string s;
		for (int i=0; i<n; i++)
		{
			cin >> s;
			a[s[0]-'0']++;
			a[s[1]-'0']++;
		}

		int odd=0;
		for (int i=0; i<7; i++)
			if (a[i]%2)
				odd++;

		cout << ((odd==0||odd==2) ? "Yes" : "No") << endl;
	}
}

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

#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

int N;
int boss[7],height[7];

int get_boss(int id){
	if(boss[id] == id)return id;
	else{
		return boss[id] = get_boss(boss[id]);
	}
}

int is_same(int x,int y){
	return get_boss(x) == get_boss(y);
}

void unite(int x,int y){
	int boss_x = get_boss(x);
	int boss_y = get_boss(y);

	if(boss_x == boss_y)return;

	if(height[x] > height[y]){

		boss[boss_y] = boss_x;

	}else if(height[x] < height[y]){

		boss[boss_x] = boss_y;

	}else{ //height[x] == height[y]

		boss[boss_y] = boss_x;
		height[x]++;
	}
}

void init(){
	for(int i = 0; i < 7; i++){
		boss[i] = i;
		height[i] = 0;
	}
}

int main(){

	int array[7],num,num_KI,num_boss;

	char buf[3];
	int a,b;

	while(scanf("%d",&N) != EOF){

		init();
		for(int i = 0; i < 7; i++)array[i] = 0;

		for(int i = 0; i < N; i++){
			scanf("%s",buf);
			a = buf[0] - '0';
			b = buf[1] - '0';
			array[a]++;
			array[b]++;
			unite(a,b);
		}

		if(N == 1){
			printf("Yes\n");
			continue;
		}

		num_KI = 0;

		for(int i = 0; i < 7; i++){
			if(array[i]%2 == 1)num_KI++;
		}

		if(num_KI != 0 && num_KI != 2){
			printf("No\n");
			continue;
		}

		num_boss = 0;
		for(int i = 0; i < 7; i++){
			if(array[i] != 0){
				if(boss[i] == get_boss[i])num_boss++;
			}
		}

		if(num_boss > 1){
			printf("No\n");
			continue;
		}

		printf("Yes\n");
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:99:57: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   99 |                                 if(boss[i] == get_boss[i])num_boss++;
      |                                                         ^
a.cc:99:44: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   99 |                                 if(boss[i] == get_boss[i])num_boss++;
      |                                    ~~~~~~~~^~~~~~~~~~~~~~
Language: C++

#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

int N;
int boss[7],height[7];

int get_boss(int id){
	if(boss[id] == id)return id;
	else{
		return boss[id] = get_boss(boss[id]);
	}
}

void unite(int x,int y){
	int boss_x = get_boss(x);
	int boss_y = get_boss(y);

	if(boss_x == boss_y)return;

	if(height[x] > height[y]){

		boss[boss_y] = boss_x;

	}else if(height[x] < height[y]){

		boss[boss_x] = boss_y;

	}else{ //height[x] == height[y]

		boss[boss_y] = boss_x;
		height[x]++;
	}
}

void init(){
	for(int i = 0; i < 7; i++){
		boss[i] = i;
		height[i] = 0;
	}
}

int main(){

	int array[7],num,num_KI,num_boss;

	char buf[3];
	int a,b;

	bool FLG;

	while(scanf("%d",&N) != EOF){

		init();
		for(int i = 0; i < 7; i++)array[i] = 0;

		for(int i = 0; i < N; i++){
			scanf("%s",buf);
			a = buf[0] - '0';
			b = buf[1] - '0';
			array[a]++;
			array[b]++;
			unite(a,b);
		}
		FLG = true;

		num_KI = 0;

		for(int i = 0; i < 7; i++)if(array[i]%2 == 1)num_KI++;

		if(num_KI > 2){
			printf("No\n");
			continue;
		}

		num_boss = 0;
		for(int i = 0; i < 7; i++){
			if(array[i] > 0 && boss[i] == get_boss[i])num_boss++;
		}
		if(num_boss > 1)FLG = false;

		if(FLG){
			printf("Yes\n");
		}else{
			printf("No\n");
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:90:65: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   90 |                         if(array[i] > 0 && boss[i] == get_boss[i])num_boss++;
      |                                                                 ^
a.cc:90:52: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   90 |                         if(array[i] > 0 && boss[i] == get_boss[i])num_boss++;
      |                                            ~~~~~~~~^~~~~~~~~~~~~~
Language: C++

include<iostream>
using namespace std;
int main(void){
  while(true){
    int n;
    cin>>n;
    if(cin.eof())
      break;
    cout << (1 << (n-1)) << endl;
  }
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>n;
      |     ^~~
a.cc:9:5: error: 'cout' was not declared in this scope
    9 |     cout << (1 << (n-1)) << endl;
      |     ^~~~
a.cc:9:29: error: 'endl' was not declared in this scope
    9 |     cout << (1 << (n-1)) << endl;
      |                             ^~~~
Language: C++

/*
AizuOnline A1011
Title
*/
#include <stdio.h>
// Select Below
//#include <stdlib.h>
//#include <string.h>
//#include <float.h>
//#include <math.h>
//#include <limits.h>
//Global data section

//
int N;

int expt3(int n)
{
  if(n==0)
    return(1);
  else
    return(3 * expt3(n-1));
}
int calc_carbon(int n)
{
  int i,ret;

  ret=0;
  for(i=0;i<n;i++)
    ret += expt3(i);
  //printf("CC1:%d %d\n",n,ret);
  return(ret);
}
calcc(int n)
{
  int i,ret;



  if(n==1)
    return(1);
  if(n==2)
    return(2);


  if(n % 2)
    {
      ret = 2*calc_carbon((n-1)/2);
    }
  else
    ret=0;
  for(i=0;i<(n-(n % 2))/2;i++)
    ret += 4*calc_carbon(i);
    
  return(ret+n);
}
main()
{
  int ret;



  while(EOF != scanf("%d",&N))
    {
      ret=calcc(N);
      printf("%d\n",ret);
    }
return(0);
}

Compiler output:
a.cc:34:1: error: ISO C++ forbids declaration of 'calcc' with no type [-fpermissive]
   34 | calcc(int n)
      | ^~~~~
a.cc:57:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   57 | main()
      | ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
int x,p,n;
char c;
string S;
set<int>st[6],uni;
set<int>bnf();
set<int>::iterator it;
void Prin(set<int> ans){
  if(!ans.size())cout<<"NULL"<<endl;
  else for(it=ans.begin();it!=ans.end();it++){
    if(it!=ans.begin())cout<<' ';
    cout<<*it;
  }
  cout<<endl;
}
set<int> U(set<int> a,set<int> b){
  set<int>s=b;
  it=a.begin();
  while(it!=a.end())s.insert(*it),it++;
  return s;
}
set<int> I(set<int> a,set<int> b){
  set<int>s;
  it=a.begin();
  while(it!=a.end()){
    if(b.count(*it))s.insert(*it);
    it++;
  }
  return s;
}
set<int> D(set<int> a,set<int> b){
  set<int>s;
  it=a.begin();
  while(it!=a.end()){
    if(!b.count(*it))s.insert(*it);
    it++;
  }
  return s;
}
set<int> C(set<int> a,set<int> b){
  set<int>s;
  it=a.begin();
  while(it!=a.end()){
    if(!b.count(*it))s.insert(*it);
    it++;
  }
  return s;
}
set<int> ge(){
  set<int>s;
  if(S[p]=='(')p++,s=bnf(),p++;
  else if(S[p]=='c')p++,s=C(uni,st[S[p++]-'A']);
  else if('A'<=S[p]&&S[p]<='Z')s=st[S[p++]-'A'];
  return s;
}
set<int> bnf(){
  set<int>s=ge();
  while('a'<=S[p]&&S[p]<='z'){
    int t=p++;
    set<int>g=ge();
    if(S[t]=='u')s=U(s,g);
    if(S[t]=='i')s=I(s,g);
    if(S[t]=='d')s=D(s,g);
    if(S[t]=='s')s=U(D(s,g),D(g,s));
  }
  return s;
}
main(){
  while(cin>>c){
    p=0;
    uni.clear();
    r(i,6)st[i].clear();
    cin>>n;
    r(i,n)cin>>x,st[c-'A'].insert(x),uni.insert(x);
    while(1){
      cin>>c>>n;
      if(c=='R')break;
      r(i,n)cin>>x,st[c-'A'].insert(x),uni.insert(x);
    }
    cin>>S;
    set<int>ans=bnf();if(and.size()==0)exit(0);
    Prin(ans);
  }
}

Compiler output:
a.cc:70:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   70 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:83:29: error: expected identifier before '.' token
   83 |     set<int>ans=bnf();if(and.size()==0)exit(0);
      |                             ^
a.cc:83:29: error: expected ')' before '.' token
   83 |     set<int>ans=bnf();if(and.size()==0)exit(0);
      |                         ~   ^
      |                             )
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
int x,p,n;
char c;
string S;
set<int>st[6],uni;
set<int>bnf();
set<int>::iterator it;
void Prin(set<int> ans){
  //if(!ans.size())cout<<"NULL"<<endl;
  for(it=ans.begin();it!=ans.end();it++){
    if(it!=ans.begin())cout<<' ';
    cout<<*it;
  }
  if(!ans.size())cout<<"NULL"<<endl;
  cout<<endl;
}
set<int> U(set<int> a,set<int> b){
  set<int>s=b;
  it=a.begin();
  while(it!=a.end())s.insert(*it),it++;
  return s;
}
set<int> I(set<int> a,set<int> b){
  set<int>s;
  it=a.begin();
  while(it!=a.end()){
    if(b.count(*it))s.insert(*it);
    it++;
  }
  return s;
}
set<int> D(set<int> a,set<int> b){
  set<int>s;
  it=a.begin();
  while(it!=a.end()){
    if(!b.count(*it))s.insert(*it);
    it++;
  }
  return s;
}
set<int> C(set<int> a,set<int> b){
  set<int>s;
  it=a.begin();
  while(it!=a.end()){
    if(!b.count(*it))s.insert(*it);
    it++;
  }
  return s;
}
set<int> ge(){
  set<int>s;
  if(S[p]=='(')p++,s=bnf(),p++;
  else if(S[p]=='c'){
    while(S[p]=='c')p++;
   s=C(uni,uni]);
  }
  else if('A'<=S[p]&&S[p]<='Z')s=st[S[p++]-'A'];
  return s;
}
set<int> bnf(){
  set<int>s=ge();
  while('a'<=S[p]&&S[p]<='z'){
    int t=p++;
    set<int>g=ge();
    if(S[t]=='u')s=U(s,g);
    if(S[t]=='i')s=I(s,g);
    if(S[t]=='d')s=D(s,g);
    if(S[t]=='s')s=U(D(s,g),D(g,s));
  }
  return s;
}
main(){
  while(cin>>c){
    p=0;
    uni.clear();
    r(i,6)st[i].clear();
    cin>>n;
    r(i,n)cin>>x,st[c-'A'].insert(x),uni.insert(x);
    while(1){
      cin>>c>>n;
      if(c=='R')break;
      r(i,n)cin>>x,st[c-'A'].insert(x),uni.insert(x);
    }
    cin>>S;
    set<int>ans=bnf();
    Prin(ans);
  }
}

Compiler output:
a.cc: In function 'std::set<int> ge()':
a.cc:57:15: error: expected ')' before ']' token
   57 |    s=C(uni,uni]);
      |       ~       ^
      |               )
a.cc: At global scope:
a.cc:74:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   74 | main(){
      | ^~~~