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

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

int main(){
    int dice[6],a;
    string order;
    for(int i=0;i<6;i++){
        cin>>dice[6];
    }
    cin>>order;
    
    for(int i=0;i<order.length();i++){
        if(order[i]=="E"){
            a=dice[1];
            dice[1]=dice[4];
            dice[4]=dice[6];
            dice[6]=dice[3];
            dice[3]=a;
        }
        else if(order[i]=="N"){
            a=dice[1];
            dice[1]=dice[2];
            dice[2]=dice[6];
            dice[6]=dice[5];
            dice[5]=a;
        }
        else if(order[i]=="S"){
            a=dice[1];
            dice[1]=dice[5];
            dice[5]=dice[6];
            dice[6]=dice[2];
            dice[2]=a;
        }
        else if(order[i]=="W"){
            a=dice[1];
            dice[1]=dice[3];
            dice[3]=dice[6];
            dice[6]=dice[4];
            dice[4]=a;
        }
    }
    cout<<dice[1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |         if(order[i]=="E"){
a.cc:21:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |         else if(order[i]=="N"){
a.cc:28:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   28 |         else if(order[i]=="S"){
a.cc:35:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   35 |         else if(order[i]=="W"){
Language: C++

d = list(map(int, input().split()))
order = input()
class Dice():
    def __init__(self, d):
        self.dice = d

    def InsSN(self, one, two, five, six):
        self.dice[0] = one
        self.dice[1] = two
        self.dice[4] = five
        self.dice[5] = six
        
    def InsWE(self, one, three, four, six):
        self.dice[0] = one
        self.dice[2] = three
        self.dice[3] = four
        self.dice[5] = six

    def S(self):
        one = self.dice[4]
        two = self.dice[0]
        five = self.dice[5]
        six = self.dice[1]
        self.InsSN(one, two, five, six)

    def N(self):
        one = self.dice[1]
        two = self.dice[5]
        five = self.dice[0]
        six = self.dice[4]
        self.InsSN(one, two, five, six)
 
    def W(self):
        one = self.dice[2]
        three = self.dice[5]
        four = self.dice[0]
        six = self.dice[3]
        self.InsWE(one, three, four, six)
        
    def E(self):
        one = self.dice[3]
        three = self.dice[0]
        four = self.dice[5]
        six = self.dice[2]
        self.InsWE(one, three, four, six)
        
    def roll(self, order):
        if order == 'S':
            self.S()
        elif order == 'N':
            self.N()
        elif order == 'E':
            self.E()
        elif order == 'W':
            self.W()
d = Dice(d)
for o in order:
    d.roll(o)
print(d.dice[0])

Compiler output:
a.cc:1:1: error: 'd' does not name a type
    1 | d = list(map(int, input().split()))
      | ^
Language: C++

#include<iostream>
using namespace std;

class Cube{
public:
  int f[6]; //??????????????°???
  Dice(){} //?????????????????????
  void roll_z(){ roll(1, 2, 4, 3);} //????????????????????§??????????????????????????°???????????¨????????????
  void roll_y(){ roll(0, 2, 5, 3);}
  void roll_x(){ roll(0, 1, 5, 4);}
  void roll(int i, int j, int k, int l){
    int t = f[i]; f[i] = f[j]; f[j] = f[k]; f[k] = f[l]; f[l] = t;
  }

  void move(char ch){
    if (ch == "E") for ( int i = 0; i < 3; i++) roll_y(); //3?????\??????????????°????????¢??¨?????????
    if (ch == "W") roll_y();
    if (ch == "N") roll_x();
    if (ch == "S") for ( int i = 0; i < 3; i++) roll_x();
  }
};

int main(){
  Cube c;
  string com;
  for ( int i = 0; i < 6; i++) cin >> c.f[i];

  for (int i = 0; i < com.size(); i++) c.move(com[i]);

  cout << c[0] << endl;


return 0;
}

Compiler output:
a.cc:7:3: error: ISO C++ forbids declaration of 'Dice' with no type [-fpermissive]
    7 |   Dice(){} //?????????????????????
      |   ^~~~
a.cc: In member function 'int Cube::Dice()':
a.cc:7:10: warning: no return statement in function returning non-void [-Wreturn-type]
    7 |   Dice(){} //?????????????????????
      |          ^
a.cc: In member function 'void Cube::move(char)':
a.cc:16:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |     if (ch == "E") for ( int i = 0; i < 3; i++) roll_y(); //3?????\??????????????°????????¢??¨?????????
      |         ~~~^~~~~~
a.cc:17:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |     if (ch == "W") roll_y();
      |         ~~~^~~~~~
a.cc:18:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |     if (ch == "N") roll_x();
      |         ~~~^~~~~~
a.cc:19:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |     if (ch == "S") for ( int i = 0; i < 3; i++) roll_x();
      |         ~~~^~~~~~
a.cc: In function 'int main()':
a.cc:30:12: error: no match for 'operator[]' (operand types are 'Cube' and 'int')
   30 |   cout << c[0] << endl;
      |            ^
Language: C++

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


enum Face{
	TOP,
	SOUTH,
	EAST,
	WEST,
	NORTH,
	BOTTOM,
};

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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


enum Face{
	TOP,
	SOUTH,
	EAST,
	WEST,
	NORTH,
	BOTTOM,
};

class Dice{
private:
	std::vector<int> faces_;	

public:
	Dice(const std::vector<int> &labels) : faces_(labels){
		return;
	}

	~Dice(){
		return;
	}

Compiler output:
a.cc:26:10: error: expected '}' at end of input
   26 |         }
      |          ^
a.cc:15:11: note: to match this '{'
   15 | class Dice{
      |           ^
a.cc:26:10: error: expected unqualified-id at end of input
   26 |         }
      |          ^
Language: C++

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


enum Face{
	TOP,
	SOUTH,
	EAST,
	WEST,
	NORTH,
	BOTTOM,
};

class Dice{
private:
	std::vector<int> faces_;	

public:
	Dice(const std::vector<int> &labels) : faces_(labels){
		return;
	}

	~Dice(){
		return;
	}

	void roll_north(){
		int tmp = faces_[TOP];
		faces_[TOP] = faces_[SOUTH];
		faces_[SOUTH] = faces_[BOTTOM];
		faces_[BOTTOM] = faces_[NORTH];
		faces_[NORTH] = tmp;
		return;
	}

	void roll_east(){
		int tmp = faces_[TOP];
		faces_[TOP] = faces_[WEST];
		faces_[WEST] = faces_[BOTTOM];
		faces_[BOTTOM] = faces_[EAST];
		faces_[EAST] = tmp;
		return;
	}

	void roll_west(){
		int tmp = faces_[TOP];
		faces_[TOP] = faces_[EAST];
		faces_[EAST] = faces_[BOTTOM];
		faces_[BOTTOM] = faces_[WEST];
		faces_[WEST] = tmp;
		return;
	}

	void roll_south(){
		int tmp = faces_[TOP];
		faces_[TOP] = faces_[NORTH];
		faces_[NORTH] = faces_[BOTTOM];
		faces_[BOTTOM] = faces_[SOUTH];
		faces_[SOUTH] = tmp;
		return;
	}

Compiler output:
a.cc:62:10: error: expected '}' at end of input
   62 |         }
      |          ^
a.cc:15:11: note: to match this '{'
   15 | class Dice{
      |           ^
a.cc:62:10: error: expected unqualified-id at end of input
   62 |         }
      |          ^
Language: C++

	void roll_to(char d){
		switch(d){
		case 'N':
			roll_north();
			break;
		case 'E':
			roll_east();
			break;
		case 'W':
			roll_west();
			break;
		case 'S':
			roll_south();
			break;
		default:
			break;
		}
		return;
	}

Compiler output:
a.cc: In function 'void roll_to(char)':
a.cc:4:25: error: 'roll_north' was not declared in this scope; did you mean 'roll_to'?
    4 |                         roll_north();
      |                         ^~~~~~~~~~
      |                         roll_to
a.cc:7:25: error: 'roll_east' was not declared in this scope
    7 |                         roll_east();
      |                         ^~~~~~~~~
a.cc:10:25: error: 'roll_west' was not declared in this scope
   10 |                         roll_west();
      |                         ^~~~~~~~~
a.cc:13:25: error: 'roll_south' was not declared in this scope; did you mean 'roll_to'?
   13 |                         roll_south();
      |                         ^~~~~~~~~~
      |                         roll_to
Language: C++

	void roll_south(){
		int tmp = faces_[TOP];
		faces_[TOP] = faces_[NORTH];
		faces_[NORTH] = faces_[BOTTOM];
		faces_[BOTTOM] = faces_[SOUTH];
		faces_[SOUTH] = tmp;
		return;
	}

	void roll_to(char d){
		switch(d){
		case 'N':
			roll_north();
			break;
		case 'E':
			roll_east();
			break;
		case 'W':
			roll_west();
			break;
		case 'S':
			roll_south();
			break;
		default:
			break;
		}
		return;
	}

Compiler output:
a.cc: In function 'void roll_south()':
a.cc:2:27: error: 'faces_' was not declared in this scope
    2 |                 int tmp = faces_[TOP];
      |                           ^~~~~~
a.cc:2:34: error: 'TOP' was not declared in this scope
    2 |                 int tmp = faces_[TOP];
      |                                  ^~~
a.cc:3:38: error: 'NORTH' was not declared in this scope
    3 |                 faces_[TOP] = faces_[NORTH];
      |                                      ^~~~~
a.cc:4:40: error: 'BOTTOM' was not declared in this scope
    4 |                 faces_[NORTH] = faces_[BOTTOM];
      |                                        ^~~~~~
a.cc:5:41: error: 'SOUTH' was not declared in this scope
    5 |                 faces_[BOTTOM] = faces_[SOUTH];
      |                                         ^~~~~
a.cc: In function 'void roll_to(char)':
a.cc:13:25: error: 'roll_north' was not declared in this scope; did you mean 'roll_south'?
   13 |                         roll_north();
      |                         ^~~~~~~~~~
      |                         roll_south
a.cc:16:25: error: 'roll_east' was not declared in this scope
   16 |                         roll_east();
      |                         ^~~~~~~~~
a.cc:19:25: error: 'roll_west' was not declared in this scope
   19 |                         roll_west();
      |                         ^~~~~~~~~
Language: C++


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

#define INPUT_FROM_FILE (0)
#if INPUT_FROM_FILE
#include <fstream>
#endif


int main(int argc, char **argv){
#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
#endif
	int num_faces = 6;
	std::vector<int> labels(num_faces, 0);
	Dice *dice = NULL;
	std::string operations;

	for(int i = 0; i < num_faces; i++){
#if INPUT_FROM_FILE
		ifs >> labels[i];
#else
		std::cin >> labels[i];
#endif;
	}

	dice = new Dice(labels);

#if INPUT_FROM_FILE
	ifs >> operations;
#else
	std::cin >> operations;
#endif;

	for(unsigned int i = 0; i < operations.size(); i++){
		dice->roll_to(operations.at(i));
	}

	std::cout << dice->get_cur_top_label() << std::endl;	
	delete dice; dice = NULL;
	return 0;
}

Compiler output:
a.cc:26:7: warning: extra tokens at end of #endif directive [-Wendif-labels]
   26 | #endif;
      |       ^
a.cc:35:7: warning: extra tokens at end of #endif directive [-Wendif-labels]
   35 | #endif;
      |       ^
a.cc: In function 'int main(int, char**)':
a.cc:18:9: error: 'Dice' was not declared in this scope
   18 |         Dice *dice = NULL;
      |         ^~~~
a.cc:18:15: error: 'dice' was not declared in this scope
   18 |         Dice *dice = NULL;
      |               ^~~~
a.cc:29:20: error: expected type-specifier before 'Dice'
   29 |         dice = new Dice(labels);
      |                    ^~~~
a.cc:42:9: error: type '<type error>' argument given to 'delete', expected pointer
   42 |         delete dice; dice = NULL;
      |         ^~~~~~~~~~~
Language: C++


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

#define INPUT_FROM_FILE (0)
#if INPUT_FROM_FILE
#include <fstream>
#endif

enum Face{
	TOP,
	SOUTH,
	EAST,
	WEST,
	NORTH,
	BOTTOM,
};

class Dice{
private:
	std::vector<int> faces_;	

public:
	Dice(const std::vector<int> &labels) : faces_(labels){
		return;
	}

	~Dice(){
		return;
	}

	

	

	





	
};
int main(int argc, char **argv){
#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
#endif
	int num_faces = 6;
	std::vector<int> labels(num_faces, 0);
	Dice *dice = NULL;
	std::string operations;

	for(int i = 0; i < num_faces; i++){
#if INPUT_FROM_FILE
		ifs >> labels[i];
#else
		std::cin >> labels[i];
#endif;
	}

	dice = new Dice(labels);

#if INPUT_FROM_FILE
	ifs >> operations;
#else
	std::cin >> operations;
#endif;

	for(unsigned int i = 0; i < operations.size(); i++){
		dice->roll_to(operations.at(i));
	}

	std::cout << dice->get_cur_top_label() << std::endl;	
	delete dice; dice = NULL;
	return 0;
}

Compiler output:
a.cc:59:7: warning: extra tokens at end of #endif directive [-Wendif-labels]
   59 | #endif;
      |       ^
a.cc:68:7: warning: extra tokens at end of #endif directive [-Wendif-labels]
   68 | #endif;
      |       ^
a.cc: In function 'int main(int, char**)':
a.cc:71:23: error: 'class Dice' has no member named 'roll_to'
   71 |                 dice->roll_to(operations.at(i));
      |                       ^~~~~~~
a.cc:74:28: error: 'class Dice' has no member named 'get_cur_top_label'
   74 |         std::cout << dice->get_cur_top_label() << std::endl;
      |                            ^~~~~~~~~~~~~~~~~
Language: C++

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

#define INPUT_FROM_FILE (0)
#if INPUT_FROM_FILE
#include <fstream>
#endif

enum Face{
	TOP,
	SOUTH,
	EAST,
	WEST,
	NORTH,
	BOTTOM,
};

class Dice{
private:
	std::vector<int> faces_;	

public:
	Dice(const std::vector<int> &labels); 
	~Dice();
 	void roll_north();
 	void roll_east();
 	void roll_west();
 	void roll_south();
 	void roll_to(char d);
 	int get_cur_top_label();
};



int main(int argc, char **argv){
#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
#endif
	int num_faces = 6;
	std::vector<int> labels(num_faces, 0);
	Dice *dice = NULL;
	std::string operations;

	for(int i = 0; i < num_faces; i++){
#if INPUT_FROM_FILE
		ifs >> labels[i];
#else
		std::cin >> labels[i];
#endif;
	}

	dice = new Dice(labels);

#if INPUT_FROM_FILE
	ifs >> operations;
#else
	std::cin >> operations;
#endif;

	for(unsigned int i = 0; i < operations.size(); i++){
		dice->roll_to(operations.at(i));
	}

	std::cout << dice->get_cur_top_label() << std::endl;	
	delete dice; dice = NULL;
	return 0;
}

Compiler output:
a.cc:50:7: warning: extra tokens at end of #endif directive [-Wendif-labels]
   50 | #endif;
      |       ^
a.cc:59:7: warning: extra tokens at end of #endif directive [-Wendif-labels]
   59 | #endif;
      |       ^
/usr/bin/ld: /tmp/cc1foMPo.o: in function `main':
a.cc:(.text+0xc7): undefined reference to `Dice::Dice(std::vector<int, std::allocator<int> > const&)'
/usr/bin/ld: a.cc:(.text+0x127): undefined reference to `Dice::roll_to(char)'
/usr/bin/ld: a.cc:(.text+0x150): undefined reference to `Dice::get_cur_top_label()'
/usr/bin/ld: a.cc:(.text+0x184): undefined reference to `Dice::~Dice()'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<algorithm>
#include<array>
#include<string>
class DICE {
private:
	array<int, 6> label;
public:
	//?????????????????????
	DICE() {
		for (unsigned int i = 0; i < label.size(); ++i) {
			std::cin >> label[i];
		}
	}
	void RotateLabel(char DIRECTION) {
		if (DIRECTION == 'N') {
			std::swap(label[5], label[4]);
			std::swap(label[4], label[0]);
			std::swap(label[1], label[0]);
		}
		if (DIRECTION == 'S') {
			std::swap(label[1], label[0]);
			std::swap(label[4], label[0]);
			std::swap(label[5], label[4]);


		}
		if (DIRECTION == 'E') {
			std::swap(label[5], label[2]);
			std::swap(label[2], label[0]);
			std::swap(label[0], label[3]);


		}
		if (DIRECTION == 'W') {
			std::swap(label[0], label[3]);
			std::swap(label[2], label[0]);
			std::swap(label[5], label[2]);
		}
	}
	int ReturnTopLabel(void) {
		return label[0];
	}
};
int main(void) {
	DICE dice1 = DICE();
	std::string InputAction;
	std::cin >> InputAction;
	for (unsigned int i = 0; i < InputAction.size(); ++i) {
		dice1.RotateLabel(InputAction[i]);
	}
	std::cout << dice1.ReturnTopLabel() << std::endl;
	//system("pause");
	return 0;
}

Compiler output:
a.cc:7:9: error: 'array' does not name a type
    7 |         array<int, 6> label;
      |         ^~~~~
a.cc: In constructor 'DICE::DICE()':
a.cc:11:46: error: 'label' was not declared in this scope
   11 |                 for (unsigned int i = 0; i < label.size(); ++i) {
      |                                              ^~~~~
a.cc: In member function 'void DICE::RotateLabel(char)':
a.cc:17:35: error: 'label' was not declared in this scope
   17 |                         std::swap(label[5], label[4]);
      |                                   ^~~~~
a.cc:22:35: error: 'label' was not declared in this scope
   22 |                         std::swap(label[1], label[0]);
      |                                   ^~~~~
a.cc:29:35: error: 'label' was not declared in this scope
   29 |                         std::swap(label[5], label[2]);
      |                                   ^~~~~
a.cc:36:35: error: 'label' was not declared in this scope
   36 |                         std::swap(label[0], label[3]);
      |                                   ^~~~~
a.cc: In member function 'int DICE::ReturnTopLabel()':
a.cc:42:24: error: 'label' was not declared in this scope
   42 |                 return label[0];
      |                        ^~~~~
Language: C++

import java.util.Scanner;
public class Main {
	private static Scanner sc=new Scanner(System.in);
	private static int[][] index;
	private static int[] def=new int[6];
	public static void main(String[] args){
		for(int i=0;i<6;i++){
			def[i]=sc.nextInt();
		}
		String command=sc.next();
		index=new int[6][command.length()+1];
		for(int i=0;i<6;i++){
			index[i][0]=def[i];
		}
		for(int i=0;i<command.length();i++){
			move(command.charAt(i),i);
		}
		System.out.println(index[0][command.length()]);
	}
	private static void move (char c,int i){
		switch(c){
		case 'E':
			index[0][i+1]=index[3][i];
			index[2][i+1]=index[0][i];
			index[5][i+1]=index[2][i];
			index[3][i+1]=index[5][i];
			break;
		case 'W':
			index[0][i+1]=index[2][i];
			index[2][i+1]=index[5][i];
			index[5][i+1]=index[3][i];
			index[3][i+1]=index[0][i];
			break;
		case 'N':
			index[0][i+1]=index[1][i];
			index[4][i+1]=index[0][i];
			index[5][i+1]=index[4][i];
			index[1][i+1]=index[5][i];
			break;
		case 'S':
			index[0][i+1]=index[4][i];
			index[4][i+1]=index[5][i];
			index[5][i+1]=index[1][i];
			index[1][i+1]=index[0][i];
			break;
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
??
class Dice {
????private:
????????int *numbers;
????public:
????????Dice(int *numbers) {
????????????this->numbers = numbers;
????????}
??
????????int getCurrentNumber() {
????????????return this->numbers[0];
????????}
??
????????void turn(char direction) {
????????????switch (direction) {
????????????????case 'N':
????????????????????this->turnNorth();
????????????????????break;
????????????????case 'S':
????????????????????this->turnSouth();
????????????????????break;
????????????????case 'E':
????????????????????this->turnEast();
????????????????????break;
????????????????case 'W':
????????????????????this->turnWest();
????????????????????break;
????????????}
????????}
??
????????void turnNorth() {
????????????swap(this->numbers[0], this->numbers[1]);
????????????swap(this->numbers[1], this->numbers[5]);
????????????swap(this->numbers[5], this->numbers[4]);
????????}
??
????????void turnSouth() {
????????????swap(this->numbers[0], this->numbers[4]);
????????????swap(this->numbers[4], this->numbers[5]);
????????????swap(this->numbers[5], this->numbers[1]);
????????}
??
????????void turnEast() {
????????????swap(this->numbers[0], this->numbers[3]);
????????????swap(this->numbers[3], this->numbers[5]);
????????????swap(this->numbers[5], this->numbers[2]);
????????}
??
????????void turnWest() {
????????????swap(this->numbers[0], this->numbers[2]);
????????????swap(this->numbers[2], this->numbers[5]);
????????????swap(this->numbers[5], this->numbers[3]);
????????}
};
??
int main() {
????int numbers[6];
????char direction;
????string directions;
??
????for (int i = 0; i < 6; i++) {
????????cin >> numbers[i];
????}
????cin >> directions;
??
????Dice dice(numbers);
????for (int i = 0; i < directions.size(); i++) {
????????dice.turn(directions[i]);
????}
??
????cout << dice.getCurrentNumber() << endl;
??
????return 0;
}

Compiler output:
a.cc:4:1: error: expected unqualified-id before '?' token
    4 | ??
      | ^
a.cc:58:1: error: expected unqualified-id before '?' token
   58 | ??
      | ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
??
class Dice{
public:
????????int dice[6];
????????int buff1, buff2, buff3;
????????void south(){
????????????????buff1 = dice[0];
????????????????buff2 = dice[1];
????????????????buff3 = dice[5];
????????????????dice[0] = dice[4];
????????????????dice[4] = buff3;
????????????????dice[5] = buff2;
????????????????dice[1] = buff1;
????????}
????????void north(){
????????????????buff1 = dice[0];
????????????????buff2 = dice[1];
????????????????buff3 = dice[5];
????????????????dice[0] = buff2;
????????????????dice[1] = buff3;
????????????????dice[5] = dice[4];
????????????????dice[4] = buff1;
????????}
????????void west(){
????????????????buff1 = dice[0];
????????????????buff2 = dice[2];
????????????????buff3 = dice[5];
????????????????dice[0] = buff2;
????????????????dice[2] = buff3;
????????????????dice[5] = dice[3];
????????????????dice[3] = buff1;
????????}
????????void east(){
????????????????buff1 = dice[0];
????????????????buff2 = dice[2];
????????????????buff3 = dice[5];
????????????????dice[2] = buff1;
????????????????dice[5] = buff2;
????????????????dice[0] = dice[3];
????????????????dice[3] = buff3;
????????}
};
??
int main()
{
????????Dice d;
????????for(int n = 0; n < 6; n++)
????????????????cin >> d.dice[n];
??
????????string command;
????????string::iterator itr;
????????char direction;
????????cin >> command;
????????for(itr = command.begin(); itr != command.end(); itr++){
????????????????direction = *itr;
????????????????if(direction == 'N')
????????????????????????d.north();
????????????????if(direction == 'S')
????????????????????????d.south();
????????????????if(direction == 'E')
????????????????????????d.east();
????????????????if(direction == 'W')
????????????????????????d.west();
????????}
????????cout << d.dice[0] << endl;
}

Compiler output:
a.cc:4:1: error: expected unqualified-id before '?' token
    4 | ??
      | ^
a.cc:46:1: error: expected unqualified-id before '?' token
   46 | ??
      | ^
Language: C++

#include <iostream>
#include <cmath>
#include <iomanip>

#define NUM_S 6

class Dice {
public:
	Dice(const int n[NUM_S]);
	int roll(char);
	int rollS();
	int rollE();
	int rollW();
	int rollN();

	void show();

private:
	int top, south, east, west, north, bottom;
};
using namespace std;


int main(void){
	int surface[NUM_S];
	char ch;
	
	for (int i = 0; i < NUM_S; i++) {
		cin >> surface[i];
	}

	Dice dice(surface);
	while (cin >> ch) {
		dice.roll(ch);
	}
	dice.show();

	return 0;
}


Dice::Dice(const int n[NUM_S]) {
	top = n[0];
	south = n[1];
	east = n[2];
	west = n[3];
	north = n[4];
	bottom = n[5];
}

int Dice::roll(char c) {
	if (c == 'S') {
		rollS();
	}
	else if (c == 'E') {
		rollE();
	}
	else if (c == 'W') {
		rollW();
	}
	else if (c == 'N') {
		ROLLN();
	}
}

int Dice::rollS() {
	int buf = top;
	top = north;
	north = bottom;
	bottom = south;
	south = buf;
	return top;
}

int Dice::rollE() {
	int buf = top;
	top = west;
	west = bottom;
	bottom = east;
	east = buf;
	return top;
}

int Dice::rollW() {
	int buf = top;
	top = east;
	east = bottom;
	bottom = west;
	west = buf;
	return top;
}

int Dice::rollN() {
	int buf = top;
	top = south;
	south = bottom;
	bottom = north;
	north = buf;
	return top;
}

void Dice::show() {
	cout << top << "\n";
}

Compiler output:
a.cc: In member function 'int Dice::roll(char)':
a.cc:62:17: error: 'ROLLN' was not declared in this scope
   62 |                 ROLLN();
      |                 ^~~~~
a.cc:64:1: warning: no return statement in function returning non-void [-Wreturn-type]
   64 | }
      | ^
Language: C++

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

int top, S, E, W, N, bot;

void what(char c)
{
		int tmp;
		switch (c) {
				case 'S':
						tmp = top;
						top = N;
						N = bot;
						bot = S;
						S = tmp;
						break;
				case 'E':
						tmp = top;
						top = W;
						W = bot;
						bot = E;
						E = tmp;
						break;
				case 'W':
						tmp = top;
						top = E;
						E = bot;
						bot = W;
						W = tmp;
						break;
				case 'N':
						tmp = top;
						top = S;
						S = bot;
						bot = N;
						N = tmp;
						break;
		}
}

/*
void print(int i)
{
		cout << "\n---" << i << "---\n";
		cout << "1:" << top << "\n";
		cout << "2:" << S << "\n";
		cout << "3:" << E << "\n";
		cout << "4:" << W << "\n";
		cout << "5:" << W << "\n";
		cout << "6:" << bot << "\n";
}
*/

int main()
{
		int i;
		string op;
		cin >> top >> S >> E >> W >> N >> bot;
		cin >> op;
		cout << "top:" << top << "\n";
		for (i=0; i<op.size(); i++) {
				what(op[i]);
				print(i);
		}
		cout << top << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:33: error: 'print' was not declared in this scope; did you mean 'printf'?
   64 |                                 print(i);
      |                                 ^~~~~
      |                                 printf
Language: C++

#include<iostream>
#include<strings>

using namespace std;
 
class Dice{
  public:
    int a[6], tmp, i;
 
    Dice(int input[6]){
      for (i = 0; i < 6; i++) {
        a[i] = input[i];
      }
    }
 
    void e() {
      tmp = a[2]; a[2] = a[0]; a[0] = a[3]; a[3] = a[5]; a[5] = tmp;
    }
 
    void n() {
      tmp = a[0]; a[0] = a[1]; a[1] = a[5]; a[5] = a[4]; a[4] = tmp;
    }
 
    void w() {
      tmp = a[0]; a[0] = a[2]; a[2] = a[5]; a[5] = a[3]; a[3] = tmp;
    }
 
    void s() {
      tmp = a[0]; a[0] = a[4]; a[4] = a[5]; a[5] = a[1]; a[1] = tmp;
    }
};
 
 
int main(void)
{
  int i, in[6];
  string command;
  for (i = 0; i < 6; i++) cin >>in[i];
  cin >> command;
  Dice d(in);
  for (i = 0; i < command.size(); i++) {
    if (command[i] == 'E') d.e();
    else if (command[i] == 'N') d.n();
    else if (command[i] == 'S') d.s();
    else if (command[i] == 'W') d.w();
  }
  cout << d.a[0] << endl;
  return 0;
}

Compiler output:
a.cc:2:9: fatal error: strings: No such file or directory
    2 | #include<strings>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<stdio.h>
#include<string.h>
typedef struct {
	char direction[100];
	int num1,num2,num3,num4,num5,num6;
}DICE_t;
int main(){
	DICE_t a;
	scanf("%d %d %d %d %d %d",&a.num1,&a.num2,&a.num3,&a.num4,&a.num5,&a.num6);
	int above,x=100,y=100;
	int dice[4][4]={{a.num1,a.num3,a.num6,a.num4},{a.num2,a.num3,a.num5,a.num4},{a.num6,a.num3,a.num1,a.num4},{a.num5,a.num3,a.num2,a.num4}};
	char dummy;
	scanf("%c",dummy);
	gets(a.direction);
	for(int i=0;a.direction[i]!=0;i++){
	    if(a.direction[i]=='N'){
		    x=(x+1)%4;		
	    }
	    else if(a.direction[i]=='S'){
		    x=(x-1)%x;
	    }
	    else if(a.direction[i]=='E'){
		    y=(y+1)%4;
	    }
	    else if(a.direction[i]=='W'){
		    y=(y-1)%4;
	    }
    }
	printf("%d",dice[x][y]);
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   14 |         gets(a.direction);
      |         ^~~~
      |         getw
Language: C++

#include<stdio.h>
#include<string.h>
typedef struct {
	char direction[100];
	int num1,num2,num3,num4,num5,num6;
}DICE_t;
int main(){
	DICE_t a;
	scanf("%d %d %d %d %d %d",&a.num1,&a.num2,&a.num3,&a.num4,&a.num5,&a.num6);
	int above,x=100,y=100;
	int dice[4][4]={{a.num1,a.num3,a.num6,a.num4},{a.num2,a.num3,a.num5,a.num4},{a.num6,a.num3,a.num1,a.num4},{a.num5,a.num3,a.num2,a.num4}};
	int e;
	if((e=getchar())=='\n'){
	    gets(a.direction);
	    for(int i=0;a.direction[i]!=0;i++){
	        if(a.direction[i]=='N'){
		        x=(x+1)%4;		
	        	if(y==2){
	        		x=x+2;
	        	}
	        }
	        else if(a.direction[i]=='S'){
		        x=(x-1)%x;
	        	if(y==2){
	        		x=x+2;
	        	}
	        }
	        else if(a.direction[i]=='E'){
		        y=(y-1)%4;
	        	if(x==2){
	        		y=y+2;
	        	}
	        }
	        else if(a.direction[i]=='W'){
		        y=(y+1)%4;
	        if(x==2){
	        		y=y+2;
	        	}}
	    	
        }
	    printf("%d",dice[x][y]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'gets' was not declared in this scope; did you mean 'getw'?
   14 |             gets(a.direction);
      |             ^~~~
      |             getw
Language: C++

#include<stdio.h>
#include<string.h>
typedef struct {
	char direction[100];
	int num1,num2,num3,num4,num5,num6;
}DICE_t;
int main(){
	DICE_t a;
	scanf("%d %d %d %d %d %d",&a.num1,&a.num2,&a.num3,&a.num4,&a.num5,&a.num6);
	int e,dummy;
	if((e=getchar())=='\n'){
	    gets(a.direction);
	    for(int i=0;a.direction[i]!=0;i++){
	        if(a.direction[i]=='N'){
		        dummy=a.num5;
	        	a.num5=a.num1;
	        	a.num1=a.num2;
	        	a.num2=a.num6;
	        	a.num6=dummy;
	        }
	        else if(a.direction[i]=='S'){
		         dummy=a.num6;
	        	a.num6=a.num2;
	        	a.num2=a.num1;
	        	a.num1=a.num5;
	        	a.num5=dummy;
	        }
	        else if(a.direction[i]=='E'){
		        dummy=a.num4;
	        	a.num4=a.num6;
	        	a.num6=a.num3;
	        	a.num3=a.num1;
	        	a.num1=dummy;
	        }
	        else if(a.direction[i]=='W'){
	            dummy=a.num1;
	        	a.num1=a.num3;
	        	a.num3=a.num6;
	        	a.num6=a.num4;
	        	a.num4=dummy;
	        }
	    	
        }
	    printf(" %d\n",a.num1);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: 'gets' was not declared in this scope; did you mean 'getw'?
   12 |             gets(a.direction);
      |             ^~~~
      |             getw
Language: C++

#include <stdio.h>
#include <iostream>
#include <math.h>
using namespace std;

int main(void)
{	
	int dice[6];
	for (int i = 0; i < 6; i++) cin >> dice[i];
	
	char order[101] = "\0";
	cin >> order;
	
	for (int j = 0; order[j] != '\0'; j++) {
		if (order[j] == 'E') moveE(dice);
		else if (order[j] == 'N') moveN(dice);
		else if (order[j] == 'S') moveS(dice);
		else moveW;
	}
	
	cout << dice[0] << endl;
	
	return 0;
}

void moveE(int dice[])
{
	int temp = dice[0];
	dice[0] = dice[3];
	dice[3] = dice[5];
	dice[5] = dice[2];
	dice[2] = temp;
}

void moveN(int dice[])
{
	int temp = dice[0];
	dice[0] = dice[1];
	dice[1] = dice[5];
	dice[5] = dice[4];
	dice[4] = temp;
}

void moveS(int dice[])
{
	int temp = dice[0];
	dice[0] = dice[4];
	dice[4] = dice[5];
	dice[5] = dice[1];
	dice[1] = temp;
}

void moveW(int dice[])
{
	int temp = dice[0];
	dice[0] = dice[2];
	dice[2] = dice[5];
	dice[5] = dice[3];
	dice[3] = temp;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:38: error: 'moveE' was not declared in this scope
   15 |                 if (order[j] == 'E') moveE(dice);
      |                                      ^~~~~
a.cc:16:43: error: 'moveN' was not declared in this scope
   16 |                 else if (order[j] == 'N') moveN(dice);
      |                                           ^~~~~
a.cc:17:43: error: 'moveS' was not declared in this scope
   17 |                 else if (order[j] == 'S') moveS(dice);
      |                                           ^~~~~
a.cc:18:22: error: 'moveW' was not declared in this scope
   18 |                 else moveW;
      |                      ^~~~~
Language: C++

#include<iostream>
using namespace std;
class Cube{
public;
int f[6];
Cube(){}
void roll_z(){roll(1,2,4,3);}
void roll_y(){roll(0,2,5,3);}
void roll_x(){roll(0,1,5,4);}
void roll(int i,int j,int k,int l){
int t=f[i];f[i]=f[j];f[j]=f[k];f[k]=f[l];f[l]=t;
}
void move(char ch){
if(ch=='E') for(int i=0;i<3;i++)roll_y;
if(ch=='W') roll_y;
if(ch=='N') roll_x;
if(ch=='S') for(int i=0;i<3;i++) roll_x;
}
};
int main(){
Cube c;
string com;
for(int i=0;i<6;i++)cin >>c.f[i];
cin >>com;
for(int i=0; i<com.size;i++)c.move(com[i]);
cout << c.f[0] <<endl;
return 0;
}

Compiler output:
a.cc:4:7: error: expected ':' before ';' token
    4 | public;
      |       ^
      |       :
a.cc: In member function 'void Cube::move(char)':
a.cc:14:33: error: invalid use of non-static member function 'void Cube::roll_y()'
   14 | if(ch=='E') for(int i=0;i<3;i++)roll_y;
      |                                 ^~~~~~
a.cc:8:6: note: declared here
    8 | void roll_y(){roll(0,2,5,3);}
      |      ^~~~~~
a.cc:15:13: error: invalid use of non-static member function 'void Cube::roll_y()'
   15 | if(ch=='W') roll_y;
      |             ^~~~~~
a.cc:8:6: note: declared here
    8 | void roll_y(){roll(0,2,5,3);}
      |      ^~~~~~
a.cc:16:13: error: invalid use of non-static member function 'void Cube::roll_x()'
   16 | if(ch=='N') roll_x;
      |             ^~~~~~
a.cc:9:6: note: declared here
    9 | void roll_x(){roll(0,1,5,4);}
      |      ^~~~~~
a.cc:17:34: error: invalid use of non-static member function 'void Cube::roll_x()'
   17 | if(ch=='S') for(int i=0;i<3;i++) roll_x;
      |                                  ^~~~~~
a.cc:9:6: note: declared here
    9 | void roll_x(){roll(0,1,5,4);}
      |      ^~~~~~
a.cc: In function 'int main()':
a.cc:25:20: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   25 | for(int i=0; i<com.size;i++)c.move(com[i]);
      |                ~~~~^~~~
      |                        ()
Language: C++

#include<iostream>
using namespace std;
class Cube{
public;
int f[6];
Cube(){}
void roll_z(){roll(1,2,4,3);}
void roll_y(){roll(0,2,5,3);}
void roll_x(){roll(0,1,5,4);}
void roll(int i,int j,int k,int l){
int t=f[i];f[i]=f[j];f[j]=f[k];f[k]=f[l];f[l]=t;
}
void move(char ch){
if(ch=='E') for(int i=0;i<3;i++)roll_y;
if(ch=='W') roll_y;
if(ch=='N') roll_x;
if(ch=='S') for(int i=0;i<3;i++) roll_x;
}
};
int main(){
Cube c;
string com;
for(int i=0;i<6;i++)cin >>c.f[i];
cin >>com;
for(int i=0; i<com.size();i++)c.move(com[i]);
cout << c.f[0] <<endl;
return 0;
}

Compiler output:
a.cc:4:7: error: expected ':' before ';' token
    4 | public;
      |       ^
      |       :
a.cc: In member function 'void Cube::move(char)':
a.cc:14:33: error: invalid use of non-static member function 'void Cube::roll_y()'
   14 | if(ch=='E') for(int i=0;i<3;i++)roll_y;
      |                                 ^~~~~~
a.cc:8:6: note: declared here
    8 | void roll_y(){roll(0,2,5,3);}
      |      ^~~~~~
a.cc:15:13: error: invalid use of non-static member function 'void Cube::roll_y()'
   15 | if(ch=='W') roll_y;
      |             ^~~~~~
a.cc:8:6: note: declared here
    8 | void roll_y(){roll(0,2,5,3);}
      |      ^~~~~~
a.cc:16:13: error: invalid use of non-static member function 'void Cube::roll_x()'
   16 | if(ch=='N') roll_x;
      |             ^~~~~~
a.cc:9:6: note: declared here
    9 | void roll_x(){roll(0,1,5,4);}
      |      ^~~~~~
a.cc:17:34: error: invalid use of non-static member function 'void Cube::roll_x()'
   17 | if(ch=='S') for(int i=0;i<3;i++) roll_x;
      |                                  ^~~~~~
a.cc:9:6: note: declared here
    9 | void roll_x(){roll(0,1,5,4);}
      |      ^~~~~~
Language: C++

#include<iostream>
using namespace std;

class Cube{
public;
int f[6];
Cube(){}
void roll_z(){roll(1,2,4,3)}
void roll_y(){roll(0,2,5,3)}
void roll_x(){roll(0,1,5,4)}
void roll(int i,int j,int k,int l){
int t=f[i]; f[i]=f[j]; f[j]=f[k]; f[k]=f[l]; f[l]=t;
}
void move(char ch){
if(ch=='E') for(int i=0;i<3;i++)roll_y;
if(ch=='W') roll_y;
if(ch=='N') roll_x;
if(ch=='S') for(int i=0;i<3;i++) roll_x;
}
};

int main(){
Cube c;
string com;
for(int i=0;i<6;i++)cin >>c.f[i];
cin >>com;
for(int i=0; i<com.size();i++)c.move(com[i]);
cout << c.f[0] <<endl;
return 0;
}

Compiler output:
a.cc:5:7: error: expected ':' before ';' token
    5 | public;
      |       ^
      |       :
a.cc: In member function 'void Cube::roll_z()':
a.cc:8:28: error: expected ';' before '}' token
    8 | void roll_z(){roll(1,2,4,3)}
      |                            ^
a.cc: In member function 'void Cube::roll_y()':
a.cc:9:28: error: expected ';' before '}' token
    9 | void roll_y(){roll(0,2,5,3)}
      |                            ^
a.cc: In member function 'void Cube::roll_x()':
a.cc:10:28: error: expected ';' before '}' token
   10 | void roll_x(){roll(0,1,5,4)}
      |                            ^
a.cc: In member function 'void Cube::move(char)':
a.cc:15:33: error: invalid use of non-static member function 'void Cube::roll_y()'
   15 | if(ch=='E') for(int i=0;i<3;i++)roll_y;
      |                                 ^~~~~~
a.cc:9:6: note: declared here
    9 | void roll_y(){roll(0,2,5,3)}
      |      ^~~~~~
a.cc:16:13: error: invalid use of non-static member function 'void Cube::roll_y()'
   16 | if(ch=='W') roll_y;
      |             ^~~~~~
a.cc:9:6: note: declared here
    9 | void roll_y(){roll(0,2,5,3)}
      |      ^~~~~~
a.cc:17:13: error: invalid use of non-static member function 'void Cube::roll_x()'
   17 | if(ch=='N') roll_x;
      |             ^~~~~~
a.cc:10:6: note: declared here
   10 | void roll_x(){roll(0,1,5,4)}
      |      ^~~~~~
a.cc:18:34: error: invalid use of non-static member function 'void Cube::roll_x()'
   18 | if(ch=='S') for(int i=0;i<3;i++) roll_x;
      |                                  ^~~~~~
a.cc:10:6: note: declared here
   10 | void roll_x(){roll(0,1,5,4)}
      |      ^~~~~~
Language: C++

#include<iostream>
using namespace std;
class Cube{
public:
int f[6];
Cube(){}
void roll_z(){roll(1,2,4,3);}
void roll_y(){roll(0,2,5,3);}
void roll_x(){roll(0,1,5,4);}
void roll(int i,int j,int k,int l){
int t=f[i]; f[i]=f[j]; f[j]=f[k]; f[k]=f[l]; f[l]=t;
}
void move(char ch){
if(ch=='E') for(int i=0;i<3;i++)roll_y;
if(ch=='W') roll_y;
if(ch=='N') roll_x;
if(ch=='S') for(int i=0;i<3;i++) roll_x;
}
};

int main(){
Cube c;
string com;
for(int i=0;i<6;i++)cin >>c.f[i];
cin >>com;
for(int i=0; i<com.size();i++)c.move(com[i]);
cout << c.f[0] <<endl;
return 0;
}

Compiler output:
a.cc: In member function 'void Cube::move(char)':
a.cc:14:33: error: invalid use of non-static member function 'void Cube::roll_y()'
   14 | if(ch=='E') for(int i=0;i<3;i++)roll_y;
      |                                 ^~~~~~
a.cc:8:6: note: declared here
    8 | void roll_y(){roll(0,2,5,3);}
      |      ^~~~~~
a.cc:15:13: error: invalid use of non-static member function 'void Cube::roll_y()'
   15 | if(ch=='W') roll_y;
      |             ^~~~~~
a.cc:8:6: note: declared here
    8 | void roll_y(){roll(0,2,5,3);}
      |      ^~~~~~
a.cc:16:13: error: invalid use of non-static member function 'void Cube::roll_x()'
   16 | if(ch=='N') roll_x;
      |             ^~~~~~
a.cc:9:6: note: declared here
    9 | void roll_x(){roll(0,1,5,4);}
      |      ^~~~~~
a.cc:17:34: error: invalid use of non-static member function 'void Cube::roll_x()'
   17 | if(ch=='S') for(int i=0;i<3;i++) roll_x;
      |                                  ^~~~~~
a.cc:9:6: note: declared here
    9 | void roll_x(){roll(0,1,5,4);}
      |      ^~~~~~
Language: C++

#include<iostream>
using namespace std;
class Cube{
public:
int f[6];
Cube(){}
void roll_z(){roll(1,2,4,3);}
void roll_y(){roll(0,2,5,3);}
void roll_x(){roll(0,1,5,4);}
void roll(int i,int j,int k,int l){
int t=f[i]; f[i]=f[j]; f[j]=f[k]; f[k]=f[l]; f[l]=t;
}
void move(char ch){
if(ch=='E') for(int i=0;i<3;i++)roll_y;
if(ch=='W') roll_y;
if(ch=='N') roll_x;
if(ch=='S') for(int i=0;i<3;i++) roll_x;
}
};
int main(){
Cube c;
string com;
for(int i=0;i<6;i++) cin >>c.f[i];
cin >>com;
for(int i=0; i<com.size();i++) c.move(com[i]);
cout << c.f[0] <<endl;
return 0;
}

Compiler output:
a.cc: In member function 'void Cube::move(char)':
a.cc:14:33: error: invalid use of non-static member function 'void Cube::roll_y()'
   14 | if(ch=='E') for(int i=0;i<3;i++)roll_y;
      |                                 ^~~~~~
a.cc:8:6: note: declared here
    8 | void roll_y(){roll(0,2,5,3);}
      |      ^~~~~~
a.cc:15:13: error: invalid use of non-static member function 'void Cube::roll_y()'
   15 | if(ch=='W') roll_y;
      |             ^~~~~~
a.cc:8:6: note: declared here
    8 | void roll_y(){roll(0,2,5,3);}
      |      ^~~~~~
a.cc:16:13: error: invalid use of non-static member function 'void Cube::roll_x()'
   16 | if(ch=='N') roll_x;
      |             ^~~~~~
a.cc:9:6: note: declared here
    9 | void roll_x(){roll(0,1,5,4);}
      |      ^~~~~~
a.cc:17:34: error: invalid use of non-static member function 'void Cube::roll_x()'
   17 | if(ch=='S') for(int i=0;i<3;i++) roll_x;
      |                                  ^~~~~~
a.cc:9:6: note: declared here
    9 | void roll_x(){roll(0,1,5,4);}
      |      ^~~~~~
Language: C++

#include <iostream>
using namespace std;

class Cube{
public:
	int f[6];
	Cube(){}
	void roll_z(){ roll(1,2,4,3);}
	void roll_y(){ roll(0,2,5,3);}
	void roll_x(){ roll(0,1,5,4);}
	void roll(int i,int j,int k,int l){
		int t = f[i]; f[i]= f[j]; j[j]=f[k]; f[k]=f[l];f[l] = t; 
	}
	void move(char ch){
		if(ch == 'E')for(int i = 0; i< 3; i++ )roll_y();
		if(ch == 'W')roll_y();
		if(ch == 'N')roll_x();
		if(ch == 'S')for(int i = 0; i< 3; i++ )roll_x();
	}
};

int main(){
	Cube c;
	string com;

	for( int i = 0; i < 6; i++) cin >> c.f[i];
		cin >> com;

	for( int i = 0; i < com.size(); i++ )c.move(com[i]);

	cout << c.f[0] << endl;

	return 0;

}

Compiler output:
a.cc: In member function 'void Cube::roll(int, int, int, int)':
a.cc:12:44: error: invalid types 'int[int]' for array subscript
   12 |                 int t = f[i]; f[i]= f[j]; j[j]=f[k]; f[k]=f[l];f[l] = t;
      |                                            ^
Language: C++

#include <stdio.h>
#include "../Header/CScreen.h"
enum ROTETYPE{
	W,
	E,
	S,
	N
};
class cDICE{
public:
	cDICE(){ Init(); };
	~cDICE(){};
	void Init(){
		int Me[6] = { 1, 2, 4, 8, 16, 32 };
		int Dice[6] = { 0, 1, 2, 3, 4, 5 };
		int Rote[2][4] = {
			{ 0, 1, 5, 4 },
			{ 2, 5, 3, 0 }
		};
		InputData(Dice, mDice);
		InputData(Me, mMe);
		for (int i = 0; i < 2; i++){
			for (int j = 0; j < 4; j++){
				mRote[i][j] = Rote[i][j];
			}
		}
	}
	void Draw(){
		//??¨???????????????
		for (int i = 0; i < 6; i++){
			printf("???????????????:%d >> ??????????????????:%d\n", mMe[i], mDice[i]);
		}
	};
	void LastDraw(){
		//?????????????????????????´¢?????????
		for (int i = 0; i < 6; i++){
			if (mDice[i] == 0){
				printf("?????????????????????:%d\n", mMe[i]);
				break;
			}
		}
	}
	int GetLast(){
		int Last = 0;
		for (int i = 0; i < 6; i++){
			if (mDice[i] == 0){
				Last = mMe[i];
				break;
			}
		}
		return Last;
	}
	void Rote(ROTETYPE _TYPE){
		int Add = 1;
		if (_TYPE == ROTETYPE::S || _TYPE == ROTETYPE::W){ Add = 3; };
		switch (_TYPE){
		case ROTETYPE::W:
			RoteH(3);
			break;
		case ROTETYPE::E:
			RoteH(1);
			break;
		case ROTETYPE::S:
			RoteV(3);
			break;
		case ROTETYPE::N:
			RoteV(1);
			break;
		}
	}
	void InputData(int _Dice[6], int _Inp[6]){
		for (int i = 0; i < 6; i++){
			_Inp[i] = _Dice[i];
		}
	}
public:
	int mMe[6];
private:
	
	void RoteV(int _Add){			//1????¬?3??????
		for (int i = 0; i < 6; i++){
			for (int j = 0; j < 4; j++){
				if (mDice[i] == mRote[0][j]){
					//int ans = (mDice[i] <= 1) ? mDice[i] : -mDice[i] + 7;
					int ans = j;
					ans = (ans + _Add) % 4;
					mDice[i] = mRote[0][ans];
					break;
				}
			}
		}
	};	//????????¢
	void RoteH(int _Add){
		for (int i = 0; i < 6; i++){
			for (int j = 0; j < 4; j++){
				if (mDice[i] == mRote[1][j]){
					int ans = j;
					ans = (ans + _Add) % 4;
					mDice[i] = mRote[1][ans];
					break;
				}
			}
		}
	};	//?¨??????¢
private:
	int mDice[6];
	int mRote[2][4];
};
int main(){
	cDICE *DiceMgr;
	char Direct[100];
	int Me[6];
	DiceMgr = new cDICE();
	scanf("%d %d %d %d %d %d", &Me[0], &Me[1], &Me[2], &Me[3], &Me[4], &Me[5]);
	DiceMgr->InputData(Me,DiceMgr->mMe);
	scanf("%s", Direct);
	for (int i = 0; Direct[i] != '\0'; i++){
		switch (Direct[i]){
		case 'S':
			DiceMgr->Rote(S);
			break;
		case 'W':
			DiceMgr->Rote(W);
			break;
		case 'E':
			DiceMgr->Rote(E);
			break;
		case 'N':
			DiceMgr->Rote(N);
			break;
		}
	}
	printf("%d\n", DiceMgr->GetLast());
	return 0;
}

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

#include <stdio.h>
#include "../Header/CScreen.h"
enum ROTETYPE{
	W,
	E,
	S,
	N
};
class cDICE{
public:
	cDICE(){ Init(); };
	~cDICE(){};
	void Init(){
		int Me[6] = { 1, 2, 4, 8, 16, 32 };
		int Dice[6] = { 0, 1, 2, 3, 4, 5 };
		int Rote[2][4] = {
			{ 0, 1, 5, 4 },
			{ 2, 5, 3, 0 }
		};
		InputData(Dice, mDice);
		InputData(Me, mMe);
		for (int i = 0; i < 2; i++){
			for (int j = 0; j < 4; j++){
				mRote[i][j] = Rote[i][j];
			}
		}
	}
	void Draw(){
		//??¨???????????????
		for (int i = 0; i < 6; i++){
			printf("???????????????:%d >> ??????????????????:%d\n", mMe[i], mDice[i]);
		}
	};
	void LastDraw(){
		//?????????????????????????´¢?????????
		for (int i = 0; i < 6; i++){
			if (mDice[i] == 0){
				printf("?????????????????????:%d\n", mMe[i]);
				break;
			}
		}
	}
	int GetLast(){
		int Last = 0;
		for (int i = 0; i < 6; i++){
			if (mDice[i] == 0){
				Last = mMe[i];
				break;
			}
		}
		return Last;
	}
	void Rote(ROTETYPE _TYPE){
		int Add = 1;
		if (_TYPE == S || _TYPE == W){ Add = 3; };
		switch (_TYPE){
		case ROTETYPE::W:
			RoteH(3);
			break;
		case ROTETYPE::E:
			RoteH(1);
			break;
		case ROTETYPE::S:
			RoteV(3);
			break;
		case ROTETYPE::N:
			RoteV(1);
			break;
		}
	}
	void InputData(int _Dice[6], int _Inp[6]){
		for (int i = 0; i < 6; i++){
			_Inp[i] = _Dice[i];
		}
	}
public:
	int mMe[6];
private:
	
	void RoteV(int _Add){			//1????¬?3??????
		for (int i = 0; i < 6; i++){
			for (int j = 0; j < 4; j++){
				if (mDice[i] == mRote[0][j]){
					//int ans = (mDice[i] <= 1) ? mDice[i] : -mDice[i] + 7;
					int ans = j;
					ans = (ans + _Add) % 4;
					mDice[i] = mRote[0][ans];
					break;
				}
			}
		}
	};	//????????¢
	void RoteH(int _Add){
		for (int i = 0; i < 6; i++){
			for (int j = 0; j < 4; j++){
				if (mDice[i] == mRote[1][j]){
					int ans = j;
					ans = (ans + _Add) % 4;
					mDice[i] = mRote[1][ans];
					break;
				}
			}
		}
	};	//?¨??????¢
private:
	int mDice[6];
	int mRote[2][4];
};
int main(){
	cDICE *DiceMgr;
	char Direct[100];
	int Me[6];
	DiceMgr = new cDICE();
	scanf("%d %d %d %d %d %d", &Me[0], &Me[1], &Me[2], &Me[3], &Me[4], &Me[5]);
	DiceMgr->InputData(Me,DiceMgr->mMe);
	scanf("%s", Direct);
	for (int i = 0; Direct[i] != '\0'; i++){
		switch (Direct[i]){
		case 'S':
			DiceMgr->Rote(S);
			break;
		case 'W':
			DiceMgr->Rote(W);
			break;
		case 'E':
			DiceMgr->Rote(E);
			break;
		case 'N':
			DiceMgr->Rote(N);
			break;
		}
	}
	printf("%d\n", DiceMgr->GetLast());
	return 0;
}

Compiler output:
a.cc:2:10: fatal error: ../Header/CScreen.h: No such file or directory
    2 | #include "../Header/CScreen.h"
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.