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

import java.util.*;

public class Main42c{
	static int T, S, E, W, N, U;
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		int[] in = new int[6];
		for(int i = 0; i < 6; i++){
			in[i] = scan.nextInt();
		}
		T = in[0];
		S = in[1];
		E = in[2];
		W = in[3];
		N = in[4];
		U = in[5];

		int q = scan.nextInt();
		for(int i = 0; i < q; i++){
			int n = scan.nextInt();
			int m = scan.nextInt();
			boolean flg = false;
			while(true){
				if(m == N){
					MoveSouth();
					MoveSouth();
				} else if(m == U){
					MoveNorth();
				} else if(m == T){
					MoveSouth();
				} else if(m == E){
					MoveWest();
				} else if(m == W){
					MoveEast();
				}
				if(m == S){
					if(n == T){
						flg = true;
						break;
					} else if(n == U){
						MoveEast();
						MoveEast();
					} else if(n == E){
						MoveWest();
					} else if(n == W){
						MoveEast();
					}
				}
				
			}
			System.out.println(E);
		}

	}

	public static void MoveSouth(){
		int a = T;
		T = N;
		N = U;
		U = S;
		S = a;
	}
	public static void MoveEast(){
		int a = T;
		T = W;
		W = U;
		U = E;
		E = a;
	}
	public static void MoveNorth(){
		int a = T;
		T = S;
		S = U;
		U = N;
		N = a;
	}
	public static void MoveWest(){
		int a = T;
		T = E;
		E = U;
		U = W;
		W = a;
	}
}

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

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){

		int[] d = new int[6];
		for(int i = 0; i < 6; i++){
			d[i] = scan.nextInt();
		}
		Dice dice = new Dice(d);
		int q = scan.nextInt();
		for(int i = 0; i < q; i++){
			int n = scan.nextInt();
			int m = scan.nextInt();
			dice.setTop(n);
			dice.setSouth(m);
			System.out.println(dice.show(Dice.EAST));
		}
	}
}

class Dice{

	int[] _d = new int[6];
	public static final int
		Top = 0, SOUTH = 1, EAST = 2,
		WEST = 3, NORTH = 4, BOTTOM = 5;

	public Dice(int[] d){ 
		for(int i = 0; i < 6; i++){
			_d[i] = d[i];
		}
	}

	public int show(int side){
		return _d[side];
	}

	public void setTop(int num){
		if(_d[TOP] != num){
			if(_d[SOUTH] == num){
				moveNorth();
			} else if(_d[EAST] == num){
				moveWest();
			} else if(_d[WEST] == num){
				moveEast();
			} else if(_d[NORTH] == num){
				moveSouth();
			} else if(_d[BOTTOM] == num){
				moveSouth();
				moveSouth();
			}
		}
	}

	public void setSouth(int num){
		for(int i = 0; i < 4; i++){
			if(_d[SOUTH] != num){
				moveRight();
			}
		}
	}

	private void moveSouth(){
		int tmp = _d[TOP];
		_d[TOP] = _d[NORTH];
		_d[NORTH] = _d[BOTTOM];
		_d[BOTTOM] = _d[SOUTH];
		_d[SOUTH] = tmp;
	}

	private void moveEast(){
		int tmp = _d[TOP];
		_d[TOP] = _d[WEST];
		_d[WEST] = _d[BOTTOM];
		_d[BOTTOM] = _d[EAST];
		_d[EAST] = tmp;
	}

	private void moveWest(){
		int tmp = _d[TOP];
		_d[TOP] = _d[EAST];
		_d[EAST] = _d[BOTTOM];
		_d[BOTTOM] = _d[WEST];
		_d[WEST] = tmp;
	}

	private void moveNorth(){
		int tmp = _d[TOP];
		_d[TOP] = _d[SOUTH];
		_d[SOUTH] = _d[BOTTOM];
		_d[BOTTOM] = _d[NORTH];
		_d[NORTH] = tmp;
	}

	private void moveRight(){
		int tmp = _d[SOUTH];
		_d[SOUTH] = _d[WEST];
		_d[WEST] = _d[NORTH];
		_d[NORTH] = _d[EAST];
		_d[EAST] = tmp;
	}
}

Compiler output:
Main.java:42: error: cannot find symbol
		if(_d[TOP] != num){
		      ^
  symbol:   variable TOP
  location: class Dice
Main.java:67: error: cannot find symbol
		int tmp = _d[TOP];
		             ^
  symbol:   variable TOP
  location: class Dice
Main.java:68: error: cannot find symbol
		_d[TOP] = _d[NORTH];
		   ^
  symbol:   variable TOP
  location: class Dice
Main.java:75: error: cannot find symbol
		int tmp = _d[TOP];
		             ^
  symbol:   variable TOP
  location: class Dice
Main.java:76: error: cannot find symbol
		_d[TOP] = _d[WEST];
		   ^
  symbol:   variable TOP
  location: class Dice
Main.java:83: error: cannot find symbol
		int tmp = _d[TOP];
		             ^
  symbol:   variable TOP
  location: class Dice
Main.java:84: error: cannot find symbol
		_d[TOP] = _d[EAST];
		   ^
  symbol:   variable TOP
  location: class Dice
Main.java:91: error: cannot find symbol
		int tmp = _d[TOP];
		             ^
  symbol:   variable TOP
  location: class Dice
Main.java:92: error: cannot find symbol
		_d[TOP] = _d[SOUTH];
		   ^
  symbol:   variable TOP
  location: class Dice
9 errors
Language: Java

import java.util.*;

public class Main{

	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		List<Integer> list = new ArrayList<Integer>();
		int[] d = new int[6];
		for(int i = 0; i < 6; i++){
			d[i] = scan.nextInt();
		}
		Dice dice = new Dice(d);
		int q = scan.nextInt();
		for(int i = 0; i < q; i++){
			int n = scan.nextInt();
			int m = scan.nextInt();
			dice.setTop(n);
			dice.setSouth(m);
			list.add(dice.show(Dice.EAST));
		}

		for(int n : list){
			System.out.println(n);
		}
	}
}

class Dice{
	int[] d_ = new int[6];
	public static final int
		TOP = 0, SOUTH = 1, EAST = 2,
		WEST = 3, NORTH = 4, BOTTOM = 5;

	public Dice(int[] d){
		for(int i = 0; i < 6; i++){
			d_[i] = d[i];
		}
	}

	public void setTop(int num){
		if(num == d_[EAST]){
			this.rollWest();
		} else if(num == d_[WEST]){
			this.rollEast();
		} else if(num == d_[SOUTH]){
			this.rollNorth();
		} else if(num == d_[NORTH]){
			this.rollSouth();
		} else if(num == d_[BOTTOM]){
			this.rollEast();
			this.rollEast();
		}
	}

	public void setSouth(int num){
		if(num == d_[EAST]){
			this.rollRight();
			this.rollRight();
			this.rollRight();
		} else if(num == d_[WEST]){
			this.rollRigtht();
		} else if(num == d_[NORTH]){
			this.rollRight();
			this.rollRight();
		}
	}

	public int show(int side){
		return d_[side];
	}

	public void rollEast(){
		int work = d_[TOP];
		d_[TOP] = d_[WEST];
		d_[WEST] = d_[BOTTOM];
		d_[BOTTOM] = d_[EAST];
		d_[EAST] = work;
	}

	public void rollWest(){
		int work = d_[TOP];
		d_[TOP] = d_[EAST];
		d_[EAST] = d_[BOTTOM];
		d_[BOTTOM] = d_[WEST];
		d_[WEST] = work;
	}

	public void rollSouth(){
		int work = d_[TOP];
		d_[TOP] = d_[NORTH];
		d_[NORTH] = d_[BOTTOM];
		d_[BOTTOM] = d_[SOUTH];
		d_[SOUTH] = work;
	}

	public void rollNorth(){
		int work = d_[TOP];
		d_[TOP] = d_[SOUTH];
		d_[SOUTH] = d_[BOTTOM];
		d_[BOTTOM] = d_[NORTH];
		d_[NORTH] = work;
	}

	public void rollRight(){
		int work = d_[SOUTH];
		d_[SOUTH] = d_[WEST];
		d_[WEST] = d_[NORTH];
		d_[NORTH] = d_[EAST];
		d_[EAST] = work;
	}
}

Compiler output:
Main.java:62: error: cannot find symbol
			this.rollRigtht();
			    ^
  symbol: method rollRigtht()
1 error
Language: Java

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

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String str = reader.readLine();
			Dice dice = new Dice(str);
			str = reader.readLine();
			int q = Integer.parseInt(str);

			for (int i = 0; i < q; i++) {
				str = reader.readLine();
				String[] face = str.split(" ");

				int j = 0;
				int k = 0;
				for (j = 0; j < 6; j++) {
					if (face[0].equals(dice.getFace(j))) {
						break;
					}
				}
				switch (j) {
				case 0:
					break;
				case 1:
					dice.moveN();
					break;
				case 2:
					dice.moveW();
					break;
				case 3:
					dice.moveE();
					break;
				case 4:
					dice.moveS();
					break;
				case 5:
					dice.moveN();
					dice.moveN();
					break;
				}
				for (k = 1; k < 5; k++) {
					if (face[1].equals(dice.getFace(k))) {
						break;
					}
				}
				int right = 0;
				switch (k) {
				case 1:
					right = 2;
					break;
				case 2:
					right = 4;
					break;
				case 3:
					right = 1;
					break;
				case 4:
					right = 3;
					break;
				}
				System.out.println(right);				System.out.println(dice.getFace(right));
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}

Compiler output:
Main.java:11: error: cannot find symbol
			Dice dice = new Dice(str);
			^
  symbol:   class Dice
  location: class Main
Main.java:11: error: cannot find symbol
			Dice dice = new Dice(str);
			                ^
  symbol:   class Dice
  location: class Main
2 errors
Language: Java

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

public class Main {
    public static void main(String[] args)  {
         Scanner sc = new Scanner(System.in);
    int dice[] = new int[6];
   
    
    for(int i=0; i<6; i++){
        dice[i] = sc.nextInt();
        }
        
    int q  = sc.nextInt();
    
    for(i =0; i<q*2; i++){
        int men [i] = sc.nextInt();    
    }

    for(int j=0; j<mei.length(); j++){
        int tmp     =0 ;
        if(rei[j] =='N'){
            tmp = dice[0];
            dice[0] = dice[1];
            dice[1] = dice[5];
            dice[5] = dice[4];
            dice[4] = tmp;
        }
        else if(rei[j]=='S'){
            tmp = dice[0];
            dice[0] = dice[4];
            dice[4] = dice[5];
            dice[5] = dice[1];
            dice[1] = tmp;
        }
        else if(rei[j]=='E'){
            tmp = dice[0];
            dice[0] = dice[3];
            dice[3] = dice[5];
            dice[5] = dice[2];
            dice[2] = tmp;
        }
        else if(rei[j] =='W'){
            tmp =dice[0];
            dice[0] = dice[2];
            dice[2] = dice[5];
            dice[5] = dice[3];
            dice[3] = tmp;
        }
    }
        System.out.println(dice[0]);

    }

   }

Compiler output:
Main.java:17: error: ']' expected
        int men [i] = sc.nextInt();    
                 ^
Main.java:17: error: ';' expected
        int men [i] = sc.nextInt();    
                  ^
2 errors
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();

		int[] dice2 = Dice.Diceget(line1);

		String line2 = sc.nextLine();
		int q = Integer.parseInt(line2);

		String[] str = new String[q];
		for (int i = 0; i < q; i++) {
			str[i] = sc.nextLine();
		}

		for (int i = 0; i < q; i++) {
			String[] sp = str[i].split(" ");
			int X = Integer.parseInt(sp[0]);
			int Y = Integer.parseInt(sp[1]);

			for (int j = 0; j < 4; j++) {
				for (int k = 0; k < 4; k++) {
					dice2 = Dice.DiceE(dice2);
					if (dice2[1] == X && dice2[2] == Y) {
						System.out.println(dice2[3]);
						break;
					}
				}
				dice2 = Dice.DiceN(dice2);
				if (dice2[1] == X && dice2[2] == Y) {
					System.out.println(dice2[3]);
					break;
				}
			}
			
		}

	}

}

public class Dice {
	public static int[] Diceget(String line) {
		int[] set = new int[7];
		String[] s = line.split(" ");
		for (int i = 1; i <= 6; i++) {
			set[i] = Integer.parseInt(s[i-1]);
		}
		return set;
	}

	public static int[] DiceE(int[] d){
		int[] dd = new int[7];
		dd[1] = d[4];
		dd[2] = d[2];
		dd[3] = d[1];
		dd[4] = d[6];
		dd[5] = d[5];
		dd[6] = d[3];
		return dd;
	}

	public static int[] DiceN(int[] d){
		int[] dd = new int[7];
		dd[1] = d[2];
		dd[2] = d[6];
		dd[3] = d[3];
		dd[4] = d[4];
		dd[5] = d[1];
		dd[6] = d[5];
		return dd;
	}

	public static int[] DiceS(int[] d){
		int[] dd = new int[7];
		dd[1] = d[5];
		dd[2] = d[1];
		dd[3] = d[3];
		dd[4] = d[4];
		dd[5] = d[6];
		dd[6] = d[2];
		return dd;
	}

	public static int[] DiceW(int[] d){
		int[] dd = new int[7];
		dd[1] = d[3];
		dd[2] = d[2];
		dd[3] = d[6];
		dd[4] = d[1];
		dd[5] = d[5];
		dd[6] = d[4];
		return dd;
	}
}

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

import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        // TODO ?????????????????????????????????????????????
        Scanner sc = new Scanner(System.in);
        String line1 = sc.nextLine();
 
        int[] dice2 = Dice.Diceget(line1);
 
        String line2 = sc.nextLine();
        int q = Integer.parseInt(line2);
 
        String[] str = new String[q];
        for (int i = 0; i < q; i++) {
            str[i] = sc.nextLine();
        }
 
        for (int i = 0; i < q; i++) {
            String[] sp = str[i].split(" ");
            int X = Integer.parseInt(sp[0]);
            int Y = Integer.parseInt(sp[1]);
 
            for (int j = 0; j < 4; j++) {
                for (int k = 0; k < 4; k++) {
                    dice2 = Dice.DiceE(dice2);
                    if (dice2[1] == X && dice2[2] == Y) {
                        System.out.println(dice2[3]);
                        break;
                    }
                }
                dice2 = Dice.DiceN(dice2);
                if (dice2[1] == X && dice2[2] == Y) {
                    System.out.println(dice2[3]);
                    break;
                }
            }
             
        }
 
    }
 
}
 
public class Dice {
    public static int[] Diceget(String line) {
        int[] set = new int[7];
        String[] s = line.split(" ");
        for (int i = 1; i <= 6; i++) {
            set[i] = Integer.parseInt(s[i-1]);
        }
        return set;
    }
 
    public static int[] DiceE(int[] d){
        int[] dd = new int[7];
        dd[1] = d[4];
        dd[2] = d[2];
        dd[3] = d[1];
        dd[4] = d[6];
        dd[5] = d[5];
        dd[6] = d[3];
        return dd;
    }
 
    public static int[] DiceN(int[] d){
        int[] dd = new int[7];
        dd[1] = d[2];
        dd[2] = d[6];
        dd[3] = d[3];
        dd[4] = d[4];
        dd[5] = d[1];
        dd[6] = d[5];
        return dd;
    }
 
    public static int[] DiceS(int[] d){
        int[] dd = new int[7];
        dd[1] = d[5];
        dd[2] = d[1];
        dd[3] = d[3];
        dd[4] = d[4];
        dd[5] = d[6];
        dd[6] = d[2];
        return dd;
    }
 
    public static int[] DiceW(int[] d){
        int[] dd = new int[7];
        dd[1] = d[3];
        dd[2] = d[2];
        dd[3] = d[6];
        dd[4] = d[1];
        dd[5] = d[5];
        dd[6] = d[4];
        return dd;
    }
}
 

 

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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		int front;
		int upper;

		String command = "W";
		Scanner sc = null;

		try {
			sc = new Scanner(System.in);

			//?????????????????????
			String line = sc.nextLine();
			Dice di = new Dice(line);
			int[] dice = di.surface;

			//????????°???????????????
			int loop = sc.nextInt();
			for (int i = 0; i < loop; i++) {

				//?????¢??¨?????¢???????????????
				upper = sc.nextInt();
				front = sc.nextInt();

				//?????????????????????????????¢???

				for (int j = 0; j < 4; j++) {

					for (int k = 0; k < 4; k++) {
						if (dice[0] != upper || dice[1] != front) {
							command = "N";
							dice = Dice.diceroll(dice, command);
							command = "W";

							for (int l = 0; l < 4; l++) {
								dice = Dice.diceroll(dice, command);
								if (dice[0] == upper && dice[1] == front) {
									break;
								}
							}

						}else{
							break;
						}
					}
					if (dice[0] != upper || dice[1] != front) {
						command = "W";
						dice = Dice.diceroll(dice, command);
					}else{
						break;
					}
				}
				int output = dice[2];
				System.out.println(output);

			}

		} finally {
			sc.close();
		}
	}

}

Compiler output:
Main.java:18: error: cannot find symbol
			Dice di = new Dice(line);
			^
  symbol:   class Dice
  location: class Main
Main.java:18: error: cannot find symbol
			Dice di = new Dice(line);
			              ^
  symbol:   class Dice
  location: class Main
Main.java:36: error: cannot find symbol
							dice = Dice.diceroll(dice, command);
							       ^
  symbol:   variable Dice
  location: class Main
Main.java:40: error: cannot find symbol
								dice = Dice.diceroll(dice, command);
								       ^
  symbol:   variable Dice
  location: class Main
Main.java:52: error: cannot find symbol
						dice = Dice.diceroll(dice, command);
						       ^
  symbol:   variable Dice
  location: class Main
5 errors
Language: Java

mport java.util.Scanner;



public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[] array = new int[6 + 1];
		array[0] = 0;
		for (int i = 1; i < array.length; i++) {
			array[i] = scan.nextInt();
		}
		int q = scan.nextInt();
		Dice dice = new Dice(array);
		int part1; int part2;
		for (int i = 0; i < q; i++) {
			part1 = scan.nextInt();
			part2 = scan.nextInt();
			System.out.println(dice.check(part1, part2));
		}
		scan.close();
	}
}
	

class Dice {
	private int[] num = new int[6 + 1];
	Dice() {
	}

	Dice(int[] array) {
		for (int i = 0; i < array.length; i++) {
			this.num[i] = array[i];
		}
	}
	
	public int[] getNum() {
		return this.num;
	}
	
	public int getNumber(int i) {
		return this.num[i];
	}
	
	// ??????????????¢??????????????????
	public int[] roll(String order) {
		int now_1 = 1;	int now_2 = 2;	int now_3 = 3;	int tmp;
		int[] array = getNum();
		char[] check = {'N', 'E', 'S', 'W'};
		for (int i = 0; i < order.length(); i++) {
			for (int j = 0; j < check.length; j++) {
				if (order.charAt(i) == check[j]) {
					switch (j + 1) {
						case 1:
							tmp = now_1;
							now_1 = now_2;
							now_2 = 7 - tmp;
							break;
						case 2:
							tmp = now_1;
							now_1 = 7 - now_3;
							now_3 = tmp;
							break;
						case 3:
							tmp = now_1;
							now_1 = 7 - now_2;
							now_2 = tmp;
							break;
						case 4:
							tmp = now_1;
							now_1 = now_3;
							now_3 = 7 - tmp;
							break;
					}
				}
			}
		}
		int[] cp_array = new int[array.length];
		cp_array[1] = array[now_1]; cp_array[2] = array[now_2];
		cp_array[3] = array[now_3]; cp_array[4] = array[7 - now_3];
		cp_array[5] = array[7 - now_2]; cp_array[6] = array[7 -now_1];
		return cp_array;
	}
	
	// 1?????????????????????????¨?????????????????????????
	public int[] turn(int[] array) {
		int tmp;
		tmp = array[2];
		array[2] = array[3];
		array[3] = array[5];
		array[5] = array[4];
		array[4] = tmp;
		
		return array;
	}
	
	// 3?????¨?????????????????????
	public int check(int part1, int part2) {
		String[] str = {"null", "N", "NN", "S", "W", "E"};
		int sum = 0;
		int[] array = new int[num.length];
		for (int i = 0; i < num.length; i++) {
			array[i] = num[i];
		}
		boolean decision = false;
		for (int i = 0; i < str.length; i++) {
			array = this.roll(str[i]);
			for (int j = 0; j < 4; j++) {
				if (array[1] == part1)
					if (array[2] == part2) {
						sum = array[3];
						decision = true;
						break;
					} else {
						array = this.turn(array);
					}
			}
			if (decision) break;
		}
		

		return sum;
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: Java

public class Main {

	int[] dice = new int[6];

	public DiceDebug(int[] nums, String order) {
		dice = nums;
	}

	public void move(String order) {

		for(Character s : order.toCharArray()) {
			int buf;
	        switch(s){
	            case 'N':{
	                buf = dice[0];
	                dice[0] = dice[1];
	                dice[1] = dice[5];
	                dice[5] = dice[4];
	                dice[4] = buf;
	                break;
	            }
	            case 'E':{
	                buf = dice[0];
	                dice[0] = dice[3];
	                dice[3] = dice[5];
	                dice[5] = dice[2];
	                dice[2] = buf;
	                break;
	            }
	            case 'W':{
	                buf = dice[0];
	                dice[0] = dice[2];
	                dice[2] = dice[5];
	                dice[5] = dice[3];
	                dice[3] = buf;
	                break;
	            }
	            case 'S':{
	                buf = dice[0];
	                dice[0] = dice[4];
	                dice[4] = dice[5];
	                dice[5] = dice[1];
	                dice[1] = buf;
	                break;
	            }
	        }
		}
	}

	public int[] checkRight(int upper, int front) {

		Random rnd = new Random();
		for(int i=0; i<10000; i++) {
			int r = rnd.nextInt(4);
			switch(r) {
				case 0:
					move("W");
					break;
				case 1:
					move("E");
					break;
				case 2:
					move("S");
					break;
				case 3:
					move("N");
					break;
				default:
					break;
			}
			if(dice[0] == upper && dice[1] == front) break;
		}

		return dice;

	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] nums = new int[6];
		for(int i=0; i<6; i++) {
			nums[i] = sc.nextInt();
		}

//		Dice dice = new Dice(nums, "");
		Main dice = new Main(nums, "");

//		String order = sc.next();

		int n = sc.nextInt();
		for(int i=0; i<n; i++) {
			int upper = sc.nextInt();
			int front = sc.nextInt();
			int[] surface = dice.checkRight(upper, front);
			System.out.println(surface[2]);
		}
		sc.close();

	}

}


Compiler output:
Main.java:5: error: invalid method declaration; return type required
	public DiceDebug(int[] nums, String order) {
	       ^
1 error
Language: Java

public class Main {

	int[] dice = new int[6];

	public Main(int[] nums, String order) {
		dice = nums;
	}

	public void move(String order) {

		for(Character s : order.toCharArray()) {
			int buf;
	        switch(s){
	            case 'N':{
	                buf = dice[0];
	                dice[0] = dice[1];
	                dice[1] = dice[5];
	                dice[5] = dice[4];
	                dice[4] = buf;
	                break;
	            }
	            case 'E':{
	                buf = dice[0];
	                dice[0] = dice[3];
	                dice[3] = dice[5];
	                dice[5] = dice[2];
	                dice[2] = buf;
	                break;
	            }
	            case 'W':{
	                buf = dice[0];
	                dice[0] = dice[2];
	                dice[2] = dice[5];
	                dice[5] = dice[3];
	                dice[3] = buf;
	                break;
	            }
	            case 'S':{
	                buf = dice[0];
	                dice[0] = dice[4];
	                dice[4] = dice[5];
	                dice[5] = dice[1];
	                dice[1] = buf;
	                break;
	            }
	        }
		}
	}

	public int[] checkRight(int upper, int front) {

		Random rnd = new Random();
		for(int i=0; i<10000; i++) {
			int r = rnd.nextInt(4);
			switch(r) {
				case 0:
					move("W");
					break;
				case 1:
					move("E");
					break;
				case 2:
					move("S");
					break;
				case 3:
					move("N");
					break;
				default:
					break;
			}
			if(dice[0] == upper && dice[1] == front) break;
		}

		return dice;

	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] nums = new int[6];
		for(int i=0; i<6; i++) {
			nums[i] = sc.nextInt();
		}

//		Dice dice = new Dice(nums, "");
		Main dice = new Main(nums, "");

//		String order = sc.next();

		int n = sc.nextInt();
		for(int i=0; i<n; i++) {
			int upper = sc.nextInt();
			int front = sc.nextInt();
			int[] surface = dice.checkRight(upper, front);
			System.out.println(surface[2]);
		}
		sc.close();

	}

}


Compiler output:
Main.java:52: error: cannot find symbol
		Random rnd = new Random();
		^
  symbol:   class Random
  location: class Main
Main.java:52: error: cannot find symbol
		Random rnd = new Random();
		                 ^
  symbol:   class Random
  location: class Main
Main.java:80: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:80: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
4 errors
Language: Java

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

 class Dice{
	int top;
	int bottom;
	int S;
	int W;
	int E;
	int N;

	Dice(int a,int b, int c,int d,int e,int f){
		this.top = a;
		this.bottom = b;
		this.S = c;
		this.W = d;
		this.E = e;
		this.N = f;
	}

	public void RollS(){
		int tmp = this.bottom;
		this.bottom = this.S;
		this.S = this.top;
		this.top = this.N;
		this.N = tmp;
}

	public void RollW(){
		int tmp =this.top;
		this.top = this.E;
		this.E = this.bottom;
		this.bottom = this.W;
		this.W = tmp;
	}

	public void RollE(){
		int tmp = this.top;
		this.top = this.W;
		this.W = this.bottom;
		this.bottom = this.E;
		this.E = tmp;
	}

	public void RollN(){
		int tmp = this.top;
		this.top = this.S;
		this.S = this.bottom;
		this.bottom = this.N;
		this.N = tmp;
	}

	public int showF(int a,int b){
		if(a == this.top){
		}else if(a == this.bottom){
			RollS();
			RollS();
		}else if(a == this.S){
			RollN();
		}else if(a == this.E){
			RollW();
		}else if(a == this.W){
			RollE();
		}else if(a == this.N){
			RollS();
		}

		if(b == this.S){
			return this.E;
		}else if(b == this.W){
			return this.S;
		}else if( b == this.N){
			return this.W;
		}else{
			return this.N;
		}
	}
}

public class Main　{
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str;
		str = br.readLine();
		String[] nums = str.split("\\s");
		int[] temp = new int[6];

		for(int i=0;i<6;i++){
			temp[i] = Integer.parseInt(nums[i]);
		}

		Dice D = new Dice(temp[0],temp[5],temp[1],temp[3],temp[2],temp[4]);
		str = br.readLine();
		int count = Integer.parseInt(str);
		for(int i = 0;i < count; i++){
			str = br.readLine();
			String[] te = str.split("\\s");
			int ans = D.showF(Integer.parseInt(te[0]),Integer.parseInt(te[1]));
			System.out.println(ans);
		}
	}
}



Compiler output:
Main.java:81: error: illegal character: '\u3000'
public class Main?{
                 ^
1 error
Language: Java

public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		class qube{
			Scanner sc = new Scanner(System.in);
			int [] face = new int[6],faces;
			Integer i,dump=0;
			Integer a,b,n;
			int ec=0,nc=0;
			

			qube(){
				for(i=0;i<6;i++){
					face[i]=sc.nextInt();
				}
				n = sc.nextInt();
				faces = face.clone();
			}

			void swap(int a,int b){
				dump = this.face[a];
				this.face[a] = this.face[b];
				this.face[b] = dump;

			}
			void scn(){
				a = sc.nextInt();
				b = sc.nextInt();
			}
			void pt(){
				System.out.printf("%d\n", this.face[2]);
			}

			void move(String es){
				if(es.equals("E")){
					if(ec == 3){
						this.move("N");
						nc = 0;
					}
					else if(ec == 6){
						this.move("N");
						nc = 0;
					}
					swap(0,2);
					swap(0,5);
					swap(0,3);
					ec++;
				}
				else if(es.equals("N")){
					/*if(nc == 3){
						this.move("E");
						ec = 0;
					}
					if(nc == 6){
						this.move("E");
						ec = 0;
					}*/
					swap(4,5);
					swap(4,1);
					swap(4,0);
					//nc++;
				}
				
			}

		}
		int j;

		qube q = new qube();
		for(j=0;j<q.n;j++){
			q.scn();
			
			while(true){
				if(q.b.equals(q.face[1])){
					break;
				}
				q.move("E");
			}
			while(true){
				if(q.a.equals(q.face[0])){
					break;
				}
				q.move("N");
			}
			q.pt();
			q.face = q.faces.clone();
		}
		
	}


Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C

#include<iostream>
using namespace std;

struct Directions
{
	int E[6] = { 2, 1, 5, 0, 4, 3 };
	int W[6] = { 3, 1, 0, 5, 4, 2 };
	int N[6] = { 4, 0, 2, 3, 5, 1 };
	int S[6] = { 1, 5, 2, 3, 0, 4 };
};

class Dice
{
public:
	int num[6];
	char dir_command[105];
	void swap(int*);
	Directions dir_array;
	Dice();
	int condition(int);
	void roll(int);
	void show_num(int);
};

Dice::Dice()
{
	Directions direction;
	for (int i = 0; i < 6; i++)
		cin >> this->num[i];
}

int Dice::condition(int i)
{
	if (dir_command[i] == '\0')
		return 0;
	else
		return 1;
}

void Dice::roll(int i)
{
	switch (this->dir_command[i])
	{
	case 'E':
		this->swap(dir_array.E);
		break;
	case 'W':
		this->swap(dir_array.W);
		break;
	case 'N':
		this->swap(dir_array.N);
		break;
	case 'S':
		this->swap(dir_array.S);
		break;
	}
	return;
}

void Dice::swap(int *dir)
{
	int tmp[6];
	for (int i = 0; i < 6; i++)
		tmp[dir[i]] = num[i];
	for (int i = 0; i < 6; i++)
		num[i] = tmp[i];
	return;
}

void Dice::show_num(int i)
{
	cout << this->num[i] << endl;
	return;
}

int main()
{
	int q, t, f;
	Dice dice;
	int a[6][4] = { {1, 2, 4, 3},
	{0, 3, 5, 2},
	{0, 1, 5, 4},
	{0, 4, 5, 1},
	{0, 2, 5, 3},
	{3, 4, 2, 1} };

	cin >> q;
	for (int i = 0; i < q; i++)
	{
		cin >> t; cin >> f;
		for (int j = 0; j < 6; j++)
			if (t == dice.num[j])
				t = j;
			else if (f == dice.num[j])
				f = j;
		for (int j = 0; j < 4; j++)
			if (a[t][j] == f)
				dice.show_num(a[t][(j + 1) % 4]);
	}

	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>
 
struct dice{
  int s1[6];
  int jmen[24],zmen[24];
};
 
int main(){
  struct dice D;
  int i,j,n;
 
  for(i=0;i<6;i++)
    scanf("%d",&D.s1[i]);
 
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d %d",&D.jmen[i],&D.zmen[i]);
 
  
    if(D.jmen[i] == D.s1[0]){
      if(D.zmen[i] == D.s1[1])printf("%d\n",D.s1[2]);
      else if(D.zmen[i] == D.s1[2])printf("%d\n",D.s1[4]);
      else if(D.zmen[i] == D.s1[3])printf("%d\n",D.s1[1]);
      else if(D.zmen[i] == D.s1[4])printf("%d\n",D.s1[3]);
    }
    else if(D.jmen[i] == D.s1[1]){
      if(D.zmen[i] == D.s1[5])printf("%d\n",D.s1[2]);
      else if(D.zmen[i] == D.s1[2])printf("%d\n",D.s1[0]);
      else if(D.zmen[i] == D.s1[3])printf("%d\n",D.s1[5]);
      else if(D.zmen[i] == D.s1[0])printf("%d\n",D.s1[3]);
    }
    else if(D.jmen[i] == D.s1[2]){
      if(D.zmen[i] == D.s1[1])printf("%d\n",D.s1[5]);
      else if(D.zmen[i] == D.s1[5])printf("%d\n",D.s1[4]);
      else if(D.zmen[i] == D.s1[0])printf("%d\n",D.s1[1]);
      else if(D.zmen[i] == D.s1[4])printf("%d\n",D.s1[0]);
    }
    else if(D.jmen[i] == D.s1[3]){
      if(D.zmen[i] == D.s1[1])printf("%d\n",D.s1[0]);
      else if(D.zmen[i] == D.s1[0])printf("%d\n",D.s1[4]);
      else if(D.zmen[i] == D.s1[5])printf("%d\n",D.s1[1]);
      else if(D.zmen[i] == D.s1[4])printf("%d\n",D.s1[5]);
    }
    else if(D.jmen[i] == D.s1[4]){
      if(D.zmen[i] == D.s1[0])printf("%d\n",D.s1[2]);
      else if(D.zmen[i] == D.s1[2])printf("%d\n",D.s1[5]);
      else if(D.zmen[i] == D.s1[3])printf("%d\n",D.s1[0]);
      else if(D.zmen[i] == D.s1[5])printf("%d\n",D.s1[3]);
    }
    else if(D.jmen[i] == D.s1[5]){
      if(D.zmen[i] == D.s1[1])printf("%d\n",D.s1[3]);
      else if(D.zmen[i] == D.s1[2])printf("%d\n",D.s1[1]);
      else if(D.zmen[i] == D.s1[3])printf("%d\n",D.s1[4]);
      else if(D.zmen[i] == D.s1[4])printf("%d\n",D.s1[2]);
    }
  }
  return 0;
}


Compiler output:
main.c:57:3: error: expected identifier or '(' before 'return'
   57 |   return 0;
      |   ^~~~~~
main.c:58:1: error: expected identifier or '(' before '}' token
   58 | }
      | ^
Language: C

#include<stdio.h>

//関数プロトタイプ宣言
void diceRoll(int *d,char *r);

int main(){
	int dice[6];	//サイコロ
	int q;			//質問の数
	int up;			//サイコロの上面
	int front;		//サイコロの前面
	
	//サイコロの作成
	for(int i = 0;i < 6;i++){
		scanf("%d",&dice[i]);
	}
	//質問の数の入力
	scanf("%d",&q)	
	
	for(int i = 0;i < q;i++){
		//上面と前面の入力
		scanf("%d %d",&up,&front);
		
		//サイコロの上面が入力されたものと違うとき
		if(dice[0] != up){
			switch(up){
				//入力された上面が前面にあったとき
				case dice[1]:
					diceRoll(dice,"N");
					break;
				//右面にあったとき
				case dice[2]:
					diceRoll(dice,"W");
					break;
				//左面にあったとき
				case dice[3]:
					diceRoll(dice,"E");
					break;
				//後面にあったとき
				case dice[4]:
					diceRoll(dice,"S");
					break;
				//底面にあったとき
				case dice[5]:
					diceRoll(dice,"NN");
					break;
			}
		}
		
		//サイコロの前面が入力されたものと違うとき
		if(dice[0] != up){
			switch(up){
				//入力された前面が右面にあったとき
				case dice[2]:
					diceRoll(dice,"R");
					break;
				//左面にあったとき
				case dice[3]:
					diceRoll(dice,"L");
					break;
				//後面にあったとき
				case dice[4]:
					diceRoll(dice,"RR");
					break;
		}
		
		//右面を表示
		printf("%d\n",dice[2]);
	}
	
	return 0;
}

void diceRoll(int *d,char *r){
	int x;	//入れ替え用変数
	for(int i = 0;r[i] != '\0';i++){
		switch(r[i]){
			//右に転がす
			case 'E':
				x = d[0];
				d[0] = d[3];
				d[3] = d[5];
				d[5] = d[2];
				d[2] = x;
				break;
			//奥に転がす
			case 'N':
				x = d[0];
				d[0] = d[1];
				d[1] = d[5];
				d[5] = d[4];
				d[4] = x;
				break;
			//手前に転がす
			case 'S':
				x = d[0];
				d[0] = d[4];
				d[4] = d[5];
				d[5] = d[1];
				d[1] = x;
				break;
			//左に転がす
			case 'W':
				x = d[0];
				d[0] = d[2];
				d[2] = d[5];
				d[5] = d[3];
				d[3] = x;
				break;
			//右に９０度回す
			case 'R':
				x = d[1];
				d[1] = d[2];
				d[2] = d[4];
				d[4] = d[3];
				d[3] = x;
				break;
			//左に９０度回す
			case 'L':
				x = d[1];
				d[1] = d[3];
				d[3] = d[4];
				d[4] = d[2];
				d[2] = x;
				break;
			
		}
	}
}



Compiler output:
main.c: In function 'main':
main.c:17:24: error: expected ';' before 'for'
   17 |         scanf("%d",&q)
      |                       ^ 
      |                        ;
   18 | 
   19 |         for(int i = 0;i < q;i++){
      |         ~~~            
main.c:128:1: error: expected declaration or statement at end of input
  128 | }
      | ^
Language: C

#include<stdio.h>

//関数プロトタイプ宣言
void diceRoll(int *d,char *r);

int main(){
	int dice[6];	//サイコロ
	int q;			//質問の数
	int up;			//サイコロの上面
	int front;		//サイコロの前面
	
	//サイコロの作成
	for(int i = 0;i < 6;i++){
		scanf("%d",&dice[i]);
	}
	//質問の数の入力
	scanf("%d",&q)	
	
	for(int i = 0;i < q;i++){
		//上面と前面の入力
		scanf("%d %d",&up,&front);
		
		//サイコロの上面が入力されたものと違うとき
		if(dice[0] != up){
			switch(up){
				//入力された上面が前面にあったとき
				case dice[1]:
					diceRoll(dice,"N");
					break;
				//右面にあったとき
				case dice[2]:
					diceRoll(dice,"W");
					break;
				//左面にあったとき
				case dice[3]:
					diceRoll(dice,"E");
					break;
				//後面にあったとき
				case dice[4]:
					diceRoll(dice,"S");
					break;
				//底面にあったとき
				case dice[5]:
					diceRoll(dice,"NN");
					break;
			}
		}
		
		//サイコロの前面が入力されたものと違うとき
		if(dice[0] != up){
			switch(up){
				//入力された前面が右面にあったとき
				case dice[2]:
					diceRoll(dice,"R");
					break;
				//左面にあったとき
				case dice[3]:
					diceRoll(dice,"L");
					break;
				//後面にあったとき
				case dice[4]:
					diceRoll(dice,"RR");
					break;
			}
		}
		
		//右面を表示
		printf("%d\n",dice[2]);
	}
	
	return 0;
}

void diceRoll(int *d,char *r){
	int x;	//入れ替え用変数
	for(int i = 0;r[i] != '\0';i++){
		switch(r[i]){
			//右に転がす
			case 'E':
				x = d[0];
				d[0] = d[3];
				d[3] = d[5];
				d[5] = d[2];
				d[2] = x;
				break;
			//奥に転がす
			case 'N':
				x = d[0];
				d[0] = d[1];
				d[1] = d[5];
				d[5] = d[4];
				d[4] = x;
				break;
			//手前に転がす
			case 'S':
				x = d[0];
				d[0] = d[4];
				d[4] = d[5];
				d[5] = d[1];
				d[1] = x;
				break;
			//左に転がす
			case 'W':
				x = d[0];
				d[0] = d[2];
				d[2] = d[5];
				d[5] = d[3];
				d[3] = x;
				break;
			//右に９０度回す
			case 'R':
				x = d[1];
				d[1] = d[2];
				d[2] = d[4];
				d[4] = d[3];
				d[3] = x;
				break;
			//左に９０度回す
			case 'L':
				x = d[1];
				d[1] = d[3];
				d[3] = d[4];
				d[4] = d[2];
				d[2] = x;
				break;
		}
	}
}



Compiler output:
main.c: In function 'main':
main.c:17:24: error: expected ';' before 'for'
   17 |         scanf("%d",&q)
      |                       ^ 
      |                        ;
   18 | 
   19 |         for(int i = 0;i < q;i++){
      |         ~~~
Language: C

#include <stdio.h>

int t[10][10]={}{
    {0,0,3,5,2,4,0},
    {0,4,0,1,6,3,0},
    {0,2,6,0,1,5,0},
    {0,5,1,0,6,2,0},
    {0,3,0,6,1,4,0},
    {0,0,4,2,5,3,0};

int main(void){
    int i,j,n,x,y,dice[10];
    
    for(i=0;i<6;i++){
        scanf("%d",&dice[i])
    }
    
    scanf("%d",&n);
    
    for(i=0;i<n;i++){
            scanf("%d %d",&x,&y);
            printf("%d\n",dice[t[x][y]]);
        }
    }
    return 0;
}


Compiler output:
main.c:3:17: error: expected ',' or ';' before '{' token
    3 | int t[10][10]={}{
      |                 ^
Language: C

#include <stdio.h>

int t[10][10]={}{
    {0,0,3,5,2,4,0},
    {0,4,0,1,6,3,0},
    {0,2,6,0,1,5,0},
    {0,5,1,0,6,2,0},
    {0,3,0,6,1,4,0},
    {0,0,4,2,5,3,0}
    };

int main(void){
    int i,j,n,x,y,dice[10];
    
    for(i=0;i<6;i++){
        scanf("%d",&dice[i])
    }
    
    scanf("%d",&n);
    
    for(i=0;i<n;i++){
            scanf("%d %d",&x,&y);
            printf("%d\n",dice[t[x][y]]);
        }
    }
    return 0;
}


Compiler output:
main.c:3:17: error: expected ',' or ';' before '{' token
    3 | int t[10][10]={}{
      |                 ^
main.c: In function 'main':
main.c:16:29: error: expected ';' before '}' token
   16 |         scanf("%d",&dice[i])
      |                             ^
      |                             ;
   17 |     }
      |     ~                        
main.c: At top level:
main.c:26:5: error: expected identifier or '(' before 'return'
   26 |     return 0;
      |     ^~~~~~
main.c:27:1: error: expected identifier or '(' before '}' token
   27 | }
      | ^
Language: C

#include <stdio.h>

int t[10][10]={}{
    {0,0,3,5,2,4,0},
    {0,4,0,1,6,3,0},
    {0,2,6,0,1,5,0},
    {0,5,1,0,6,2,0},
    {0,3,0,6,1,4,0},
    {0,0,4,2,5,3,0},
    };

int main(void){
    int i,j,n,x,y,dice[10];
    
    for(i=0;i<6;i++){
        scanf("%d",&dice[i])
    }
    
    scanf("%d",&n);
    
    for(i=0;i<n;i++){
            scanf("%d %d",&x,&y);
            printf("%d\n",dice[t[x][y]]);
        }
    }
    return 0;
}


Compiler output:
main.c:3:17: error: expected ',' or ';' before '{' token
    3 | int t[10][10]={}{
      |                 ^
main.c: In function 'main':
main.c:16:29: error: expected ';' before '}' token
   16 |         scanf("%d",&dice[i])
      |                             ^
      |                             ;
   17 |     }
      |     ~                        
main.c: At top level:
main.c:26:5: error: expected identifier or '(' before 'return'
   26 |     return 0;
      |     ^~~~~~
main.c:27:1: error: expected identifier or '(' before '}' token
   27 | }
      | ^
Language: C

#include <stdio.h>

int t[10][10]={},{
    {0,0,3,5,2,4,0},
    {0,4,0,1,6,3,0},
    {0,2,6,0,1,5,0},
    {0,5,1,0,6,2,0},
    {0,3,0,6,1,4,0},
    {0,0,4,2,5,3,0}
    };

int main(void){
    int i,j,n,x,y,dice[10];
    
    for(i=0;i<6;i++){
        scanf("%d",&dice[i])
    }
    
    scanf("%d",&n);
    
    for(i=0;i<n;i++){
            scanf("%d %d",&x,&y);
            printf("%d\n",dice[t[x][y]]);
        }
    }
    return 0;
}


Compiler output:
main.c:3:18: error: expected identifier or '(' before '{' token
    3 | int t[10][10]={},{
      |                  ^
main.c: In function 'main':
main.c:16:29: error: expected ';' before '}' token
   16 |         scanf("%d",&dice[i])
      |                             ^
      |                             ;
   17 |     }
      |     ~                        
main.c: At top level:
main.c:26:5: error: expected identifier or '(' before 'return'
   26 |     return 0;
      |     ^~~~~~
main.c:27:1: error: expected identifier or '(' before '}' token
   27 | }
      | ^
Language: C

#include <stdio.h>

int t[7][7]={},{
    {0,0,3,5,2,4,0},
    {0,4,0,1,6,3,0},
    {0,2,6,0,1,5,0},
    {0,5,1,0,6,2,0},
    {0,3,0,6,1,4,0},
    {0,0,4,2,5,3,0}
    };

int main(void){
    int i,j,n,x,y,dice[10];
    
    for(i=0;i<6;i++){
        scanf("%d",&dice[i])
    }
    
    scanf("%d",&n);
    
    for(i=0;i<n;i++){
            scanf("%d %d",&x,&y);
            printf("%d\n",dice[t[x][y]]);
        }
    }
    return 0;
}


Compiler output:
main.c:3:16: error: expected identifier or '(' before '{' token
    3 | int t[7][7]={},{
      |                ^
main.c: In function 'main':
main.c:16:29: error: expected ';' before '}' token
   16 |         scanf("%d",&dice[i])
      |                             ^
      |                             ;
   17 |     }
      |     ~                        
main.c: At top level:
main.c:26:5: error: expected identifier or '(' before 'return'
   26 |     return 0;
      |     ^~~~~~
main.c:27:1: error: expected identifier or '(' before '}' token
   27 | }
      | ^
Language: C

#include <stdio.h>

int t[7][7]={0},{
    {0,0,3,5,2,4,0},
    {0,4,0,1,6,3,0},
    {0,2,6,0,1,5,0},
    {0,5,1,0,6,2,0},
    {0,3,0,6,1,4,0},
    {0,0,4,2,5,3,0}
    };

int main(void){
    int i,j,n,x,y,dice[10];
    
    for(i=0;i<6;i++){
        scanf("%d",&dice[i])
    }
    
    scanf("%d",&n);
    
    for(i=0;i<n;i++){
            scanf("%d %d",&x,&y);
            printf("%d\n",dice[t[x][y]]);
        }
    }
    return 0;
}


Compiler output:
main.c:3:17: error: expected identifier or '(' before '{' token
    3 | int t[7][7]={0},{
      |                 ^
main.c: In function 'main':
main.c:16:29: error: expected ';' before '}' token
   16 |         scanf("%d",&dice[i])
      |                             ^
      |                             ;
   17 |     }
      |     ~                        
main.c: At top level:
main.c:26:5: error: expected identifier or '(' before 'return'
   26 |     return 0;
      |     ^~~~~~
main.c:27:1: error: expected identifier or '(' before '}' token
   27 | }
      | ^
Language: C

File Edit Options Buffers Tools C Help
void mD(char C, int *D) {
  switch (C) {
    int t;
  case 'N':
    t = D[0]; D[0] = D[1]; D[1] = D[5]; D[5] = D[4]; D[4] = t;
    break;
  case 'S':
    t = D[0]; D[0] = D[4]; D[4] = D[5]; D[5] = D[1]; D[1] = t;
    break;
  case 'E':
    t = D[0]; D[0] = D[3]; D[3] = D[5]; D[5] = D[2]; D[2] = t;
    break;
  case 'W':
    t = D[0]; D[0] = D[2]; D[2] = D[5]; D[5] = D[3]; D[3] = t;
    break;
  }
  return;
}

int main(void) {
  int D[6], d, Q, q;
  char C[]={'N','N','E','E'}; int c;
  for(d=0;d<6;d++)
    scanf("%d",&D[d]);
  scanf("%d",&Q);
  for (q=0;q<Q;q++) {
    int t,f;
    scanf("%d %d\n",&t,&f);
    for (c=0;D[0] != t;c++)
      mD(C[c], D);
    while(D[1] != f) {
      int t;
      t = D[1]; D[1] = D[2]; D[2] = D[4]; D[4] = D[3]; D[3] = t;
    }
    printf("%d\n", D[2]);
  }
  return 0;
}

Compiler output:
main.c:1:1: error: unknown type name 'File'
    1 | File Edit Options Buffers Tools C Help
      | ^~~~
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Options'
    1 | File Edit Options Buffers Tools C Help
      |           ^~~~~~~
main.c:1:11: error: unknown type name 'Options'
main.c: In function 'main':
main.c:25:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   25 |     scanf("%d",&D[d]);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | File Edit Options Buffers Tools C Help
main.c:25:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   25 |     scanf("%d",&D[d]);
      |     ^~~~~
main.c:25:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:26:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   26 |   scanf("%d",&Q);
      |   ^~~~~
main.c:26:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:31:7: error: implicit declaration of function 'mD' [-Wimplicit-function-declaration]
   31 |       mD(C[c], D);
      |       ^~
main.c:36:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   36 |     printf("%d\n", D[2]);
      |     ^~~~~~
main.c:36:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:36:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:36:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

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

class Dice{
	int mn[6];	
	
	public:
		void set(int num, int val){
			mn[num] = val;
		}
	
		void rot(char dir){
			int buf, old[6];
			memcpy(old, mn, sizeof(mn));
			switch(dir){
				case 'E':
				mn[0] = old[3];
				mn[2] = old[0];
				mn[5] = old[2];
				mn[3] = old[5];
				break;
				case 'W':
				mn[3] = old[0];
				mn[0] = old[2];
				mn[2] = old[5];
				mn[5] = old[3];
				break;
				case 'S':
				mn[0] = old[4];
				mn[1] = old[0];
				mn[5] = old[1];
				mn[4] = old[5];
				break;
				case 'N':
				mn[4] = old[0];
				mn[0] = old[1];
				mn[1] = old[5];
				mn[5] = old[4];
				break;
				case 'R':
				mn[1] = old[2];
				mn[2] = old[4];
				mn[4] = old[3];
				mn[3] = old[1];
				break;
				case 'L':
				mn[2] = old[1];
				mn[4] = old[2];
				mn[3] = old[4];
				mn[1] = old[3];
				break;
			}
		}
		
		int get(int num){
			return mn[num];
		}
		
		int serch(int val){
			int i;
			for(i = 0; 6 > i; i++){
				if(mn[i] == val) return i;
			}
			return -1;
		}
		
		void Aset(int up, int front){
			int i, su = serch(up);
			if(su == 3 || su == 2){
				while(get(0) != up){
					rot('E');
				}
			}
			else {
				while(get(0) != up){
					rot('S');
				}
			}
			while(get(1) != front){
				rot('R');
			}
		}
};


int main() {
	int b, i, n;
	Dice dice;
	
	for(i = 0; 6 > i; i++){
		scanf("%d", &b);
		dice.set(i,b);
	}
	scanf("%d", &n);
	for(i = 0; n > i; i++){
		int cm[2];
		scanf("%d%d", &cm[0], &cm[1]);
		
		dice.Aset(cm[0], cm[1]);
		printf("%d\n", dice.get(2));
	}
	return 0;
}

Compiler output:
main.c:4:1: error: unknown type name 'class'
    4 | class Dice{
      | ^~~~~
main.c:4:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    4 | class Dice{
      |           ^
main.c: In function 'main':
main.c:88:9: error: unknown type name 'Dice'
   88 |         Dice dice;
      |         ^~~~
main.c:92:21: error: request for member 'set' in something not a structure or union
   92 |                 dice.set(i,b);
      |                     ^
main.c:99:21: error: request for member 'Aset' in something not a structure or union
   99 |                 dice.Aset(cm[0], cm[1]);
      |                     ^
main.c:100:36: error: request for member 'get' in something not a structure or union
  100 |                 printf("%d\n", dice.get(2));
      |                                    ^
Language: C

#include <stdio.h>
   
typedef struct dice{
  int up;
  int front;
  int right;
  int left;
  int back;
  int down;
} dice;

dice *rotate(dice *d,char c){
  
  if(c=='N'){
    temp=d->front;
    d->front=d->down;
    d->down=d->back;
    d->back=d->up;
    d->up=temp;
  } else if(c=='S') {
    temp=d->back;
    d->back=d->down;
    d->down=d->front;
    d->front=d->up;
    d->up=temp;
  } else if(c=='E') {
    temp=d->left;
    d->left=d->down;
    d->down=d->right;
    d->right=d->up;
    d->up=temp;
  } else if(c=='W') {
    temp=d->right;
    d->right=d->down;
    d->down=d->left;
    d->left=d->up;
    d->up=temp;
  }

  return d;
}

int main(void){
  dice d1;
  dice *root;
  char c;
  int temp,i,num,utemp,ftemp;
    
  root=&d1;
  scanf("%d%d%d%d%d%d",&d1.up,&d1.front,&d1.right,&d1.left,&d1.back,&d1.down);
  scanf("%d",&num);
  for(i=0;i<num;i++){ 
    scanf("%d%d",&utemp,&ftemp);
    if(utemp==d1.up) ;
    else if(utemp==d1.front)  root=rotate(root,N);
    else if(utemp==d1.right)  root=rotate(root,W);
    else if(utemp==d1.left)  root=rotate(root,E);
    else if(utemp==d1.back)  root=rotate(root,S);
    else if(utemp==d1.down){
      root=rotate(root,N);  root=rotate(root,N);
    }

    if(ftemp==d1.front)  printf("%d\n",d1.right);
    else if(ftemp==d1.right)  printf("%d\n",d1.back);
    else if(ftemp==d1.left)  printf("%d\n",d1.front);
    else if(ftemp==d1.back)  printf("%d\n",d1.left);
  }

  return 0;
}

Compiler output:
main.c: In function 'rotate':
main.c:15:5: error: 'temp' undeclared (first use in this function)
   15 |     temp=d->front;
      |     ^~~~
main.c:15:5: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:55:48: error: 'N' undeclared (first use in this function)
   55 |     else if(utemp==d1.front)  root=rotate(root,N);
      |                                                ^
main.c:56:48: error: 'W' undeclared (first use in this function)
   56 |     else if(utemp==d1.right)  root=rotate(root,W);
      |                                                ^
main.c:57:47: error: 'E' undeclared (first use in this function)
   57 |     else if(utemp==d1.left)  root=rotate(root,E);
      |                                               ^
main.c:58:47: error: 'S' undeclared (first use in this function)
   58 |     else if(utemp==d1.back)  root=rotate(root,S);
      |                                               ^