criyle/codenet-compile-errors huggingface dataset:
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){
  int temp;

  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 'main':
main.c:56:48: error: 'N' undeclared (first use in this function)
   56 |     else if(utemp==d1.front)  root=rotate(root,N);
      |                                                ^
main.c:56:48: note: each undeclared identifier is reported only once for each function it appears in
main.c:57:48: error: 'W' undeclared (first use in this function)
   57 |     else if(utemp==d1.right)  root=rotate(root,W);
      |                                                ^
main.c:58:47: error: 'E' undeclared (first use in this function)
   58 |     else if(utemp==d1.left)  root=rotate(root,E);
      |                                               ^
main.c:59:47: error: 'S' undeclared (first use in this function)
   59 |     else if(utemp==d1.back)  root=rotate(root,S);
      |                                               ^
Language: C

#include <stdio.h>

typedef struct {
	int cur;
	int n;
	int s;
	int e;
	int w;
} Dice;

enum ROLL_DIR{
	POSITIVE,
	NEGATIVE
};

void v_index_change(int *cur, int *a, int *b)
{
	int tmp = *cur;
	*cur = *a;
	*b = tmp;
	*a = 7 - tmp;
}

void h_index_change(int *sp, int *a, int *b, int *c)
{
	int tmp = *sp;
	*sp = *a;
	*b = tmp;
	*a = 7 - tmp;
	*c = 7 - *sp;
}

void v_roll(int num, char dir, Dice *dice)
{
	int i;
	for (i = 0; i < num; i++) {
		if (dir == 'N') {
			v_index_change(&dice->cur, &dice->s, &dice->n);
		}
		else if (dir == 'S') {
			v_index_change(&dice->cur, &dice->n, &dice->s);
		}
		else if (dir == 'E') {
			v_index_change(&dice->cur, &dice->w, &dice->e);
		}
		else if (dir == 'W') {
			v_index_change(&dice->cur, &dice->e, &dice->w);
		}
	}
}

void h_roll(char sp, int num, ROLL_DIR dir, Dice *dice)
{
	int i;
	for (i = 0; i < num; i++) {
		if (sp == 'N') {
			if (dir == POSITIVE) {
				h_index_change(&dice->n, &dice->w, &dice->e, &dice->s);
			}
			else if (dir == NEGATIVE) {
				h_index_change(&dice->n, &dice->e, &dice->w, &dice->s);
			}
		}
		else if (sp == 'S') {
			if (dir == POSITIVE) {
				h_index_change(&dice->s, &dice->e, &dice->w, &dice->n);
			}
			else if (dir == NEGATIVE) {
				h_index_change(&dice->s, &dice->w, &dice->e, &dice->n);
			}
		}
		else if (sp == 'E') {
			if (dir == POSITIVE) {
				h_index_change(&dice->e, &dice->n, &dice->s, &dice->w);
			}
			else if (dir == NEGATIVE) {
				h_index_change(&dice->e, &dice->s, &dice->n, &dice->w);
			}
		}
		else if (sp == 'W') {
			if (dir == POSITIVE) {
				h_index_change(&dice->w, &dice->s, &dice->n, &dice->e);
			}
			else if (dir == NEGATIVE) {
				h_index_change(&dice->w, &dice->n, &dice->s, &dice->e);
			}
		}
	}
}

int main(int argc, char** argv)
{
	Dice dice;
	int i, j, num[6], q, up, front, up_ind, front_ind;

	for (i = 0; i < 6; i++) {
		scanf("%d", &num[i]);
	}

	scanf("%d", &q);

	for (i = 0; i < q; i++) {
		scanf("%d %d", &up, &front);

		for (j = 0; j < 6; j++) {

			if (num[j] == up) {
				up_ind = j + 1;
			}
			else if (num[j] == front) {
				front_ind = j + 1;
			}
		}

		dice.cur = 1;
		dice.n = 5;
		dice.s = 2;
		dice.e = 3;
		dice.w = 4;

		if (up == dice.n) {
			v_roll(1, 'S', &dice);
		}
		else if (up == dice.s) {
			v_roll(1, 'N', &dice);
		}
		else if (up == dice.e) {
			v_roll(1, 'W', &dice);
		}
		else if (up == dice.w) {
			v_roll(1, 'E', &dice);
		}
		else {
			v_roll(2, 'S', &dice);
		}

		if (front == dice.n) {
			h_roll('S', 2, POSITIVE, &dice);
		}
		else if (front == dice.e) {
			h_roll('S', 1, NEGATIVE, &dice);
		}
		else if (front == dice.w) {
			h_roll('S', 1, POSITIVE, &dice);
		}

		printf("%d\n", num[dice.e - 1]);
	}

	return 0;
}

Compiler output:
main.c:52:31: error: unknown type name 'ROLL_DIR'
   52 | void h_roll(char sp, int num, ROLL_DIR dir, Dice *dice)
      |                               ^~~~~~~~
main.c: In function 'main':
main.c:138:25: error: implicit declaration of function 'h_roll'; did you mean 'v_roll'? [-Wimplicit-function-declaration]
  138 |                         h_roll('S', 2, POSITIVE, &dice);
      |                         ^~~~~~
      |                         v_roll
Language: C

#include<stdio.h>

struct Dice
{
	int mae;
	int ue;
	int migi;
	int hidari;
	int sita;
	int usiro;
};

struct Dice ROLL_E(struct Dice dice)
{
	
	int a = dice.ue;
	dice.ue = dice.hidari;
	dice.hidari = dice.sita;
	dice.sita = dice.migi;
	dice.migi = a;
	
	return dice;
}

struct Dice ROLL_N(struct Dice dice)
{
	int a = dice.ue;
	dice.ue = dice.mae;
	dice.mae = dice.sita;
	dice.sita = dice.usiro;
	dice.usiro = a;
	
	return dice;
}
struct Dice ROLL_S(struct Dice dice)
{
	int a = dice.ue;
	dice.ue = dice.usiro;
	dice.usiro = dice.sita;
	dice.sita = dice.mae;
	dice.mae = a;
	
	return dice;
}
struct Dice ROLL_W(struct Dice dice)
{
	int a = dice.ue;
	dice.ue = dice.migi;
	dice.migi = dice.sita;
	dice.sita =dice. hidari;
	dice.hidari = a;
	
	return dice;
}

struct Dice ROLL_TOP(struct Dice dice,int top)
{
	if(top == dice.mae){
		dice =  ROLL_N(dice);
	}else if(top == dice.migi){
		dice =  ROLL_W(dice);
	}else if(top == dice.hidari){
		dice =  ROLL_E(dice);
	}else if(top == dice.usiro){
		dice =  ROLL_S(dice);
	}else if(top == dice.sita){
		dice =  ROLL_W(dice);
		dice =  ROLL_W(dice);
	}
	return dice;
}

struct Dice ROLL_FRONT(struct Dice dice,int front)
{
	dice = ROLL_TOP(dice,front);
	dice = ROLL_N(dice);
	return dice;
}

struct Dice ROLL(struct Dice dice,int front,int top)
{
	dice = ROLL_FRONT(dice,front);
	dice = ROLL_TOP(dice,top);
	return dice;
}

struct Dice scan()
{
	struct Dice dice;
	
	scanf("%d\n",&dice.ue);
	scanf("%d\n",&dice.mae);
	scanf("%d\n",&dice.migi);
	scanf("%d\n",&dice.hidari);
	scanf("%d\n",&dice.usiro);
	scanf("%d\n",&dice.sita);
	
	return dice;
}
int main()
{
	int i,n,front,top;
	struct Dice dice;

	dice = scan();
	
	scanf("%d",&n);
	
	for(i=0;i<n;i++){
		scanf("%d%d",&front,&top);
		dice = ROLL(dice,front,top);
		printf("%d\n",dice.migi);
	}
	
	

Compiler output:
main.c: In function 'main':
main.c:113:9: error: expected declaration or statement at end of input
  113 |         }
      |         ^
Language: C

#include <stdio.h>

int
get_right_surface(int *surfaces, int top, int front)
{
	if (top == surfaces[0] && front == surfaces[1]) return surfaces[2];
	if (top == surfaces[0] && front == surfaces[2]) return surfaces[4];
	if (top == surfaces[0] && front == surfaces[4]) return surfaces[3];
	if (top == surfaces[0] && front == surfaces[3]) return surfaces[1];
	if (top == surfaces[1] && front == surfaces[5]) return surfaces[2];
	if (top == surfaces[1] && front == surfaces[2]) return surfaces[0];
	if (top == surfaces[1] && front == surfaces[0]) return surfaces[3];
	if (top == surfaces[1] && front == surfaces[3]) return surfaces[5];
	if (top == surfaces[2] && front == surfaces[1]) return surfaces[5];
	if (top == surfaces[2] && front == surfaces[5]) return surfaces[4];
	if (top == surfaces[2] && front == surfaces[4]) return surfaces[0];
	if (top == surfaces[2] && front == surfaces[0]) return surfaces[1];
	if (top == surfaces[3] && front == surfaces[1]) return surfaces[0];
	if (top == surfaces[3] && front == surfaces[0]) return surfaces[4];
	if (top == surfaces[3] && front == surfaces[4]) return surfaces[5];
	if (top == surfaces[3] && front == surfaces[5]) return surfaces[1];
	if (top == surfaces[4] && front == surfaces[2]) return surfaces[5];
	if (top == surfaces[4] && front == surfaces[5]) return surfaces[3];
	if (top == surfaces[4] && front == surfaces[3]) return surfaces[0];
	if (top == surfaces[4] && front == surfaces[0]) return surfaces[2];
	if (top == surfaces[5] && front == surfaces[1]) return surfaces[3];
	if (top == surfaces[5] && front == surfaces[3]) return surfaces[4];
	if (top == surfaces[5] && front == surfaces[4]) return surfaces[2];
	if (top == surfaces[5] && front == surfaces[2]) return surfaces[1];
	return 0;
}

int
main()
{
	int surfaces[6];
	for (i = 0; i < 6; i++)
	{
		scanf("%d", &surfaces[i]);
	}

	int i;
	int top, front;
	int n_questions;
	scanf("%d", &n_questions);
	for (i = 0; i < n_questions; i++)
	{
		scanf("%d %d", &top, &front);
		printf("%d\n", get_right_surface(surfaces, top, front));
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:37:14: error: 'i' undeclared (first use in this function)
   37 |         for (i = 0; i < 6; i++)
      |              ^
main.c:37:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>
struct sai {
	int A;
};
int main(void){
    int i,len,p,u,y,e=0,g;
    char x[100];
    struct sai r[6];
    struct sai s;
    for(i=0;i<6;i++){
    	scanf("%d",&r[i].A);
    }
    scanf("%d",&p);
    for(g=0;e<p;g++){
    	scanf("%d %d",&u,&y);
    	for(e=0;e<1;){
    	while(r[0]!=u){
    	s=r[0];
    	r[0]=r[4];
    	r[4]=r[5];
    	r[5]=r[1];
    	r[1]=s;
    	}
    while(r[1]!=y){
    	s=r[1];
    	r[1]=r[2];
    	r[2]=r[4];
    	r[4]=r[3];
    	r[3]=s;
    }
    	if(r[0]==u&&r[1]==y){
    		printf("%d\n",r[2]);
    		e++;
    	}
    	
    }
    
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:19: error: invalid operands to binary != (have 'struct sai' and 'int')
   18 |         while(r[0]!=u){
      |               ~~~~^~
      |                |
      |                struct sai
main.c:25:15: error: invalid operands to binary != (have 'struct sai' and 'int')
   25 |     while(r[1]!=y){
      |           ~~~~^~
      |            |
      |            struct sai
main.c:32:16: error: invalid operands to binary == (have 'struct sai' and 'int')
   32 |         if(r[0]==u&&r[1]==y){
      |            ~~~~^~
      |             |
      |             struct sai
main.c:32:25: error: invalid operands to binary == (have 'struct sai' and 'int')
   32 |         if(r[0]==u&&r[1]==y){
      |                     ~~~~^~
      |                      |
      |                      struct sai
Language: C

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

void turn(int *DICE,char com);

int main(void){
int i,q,top,front;
int DICE[6];
char com[105];
for(i=0;i<6;i++){scanf("%d",&DICE[i]);}
scanf("%d",&q);
for(j=0;j<q;j++){
	scanf("%d %d",&top,&front);
	strcpy(com,"SSSSESSSS");
	i=0;
	while(DICE[1]!=front){
		if(com[i]=='\0'){break;}
		turn(&DICE[0],com[i]);
		i++;
	}
	strcpy(com,"EEEE");
	i=0;
	while(DICE[0]!=top){
		if(com[i]=='\0'){break;}
		turn(&DICE[0],com[i]);
		i++;
	}
	printf("%d\n",DICE[2]);
}
return 0;
}

void turn(int *DICE,char com){
int temp;
switch(com){
	case 'N':
		temp     =*DICE;
		*DICE    =*(DICE+1);
		*(DICE+1)=*(DICE+5);
		*(DICE+5)=*(DICE+4);
		*(DICE+4)=temp;
		break;
	case 'S':
		temp     =*DICE;
		*DICE    =*(DICE+4);
		*(DICE+4)=*(DICE+5);
		*(DICE+5)=*(DICE+1);
		*(DICE+1)=temp;
		break;
	case 'E':
		temp     =*DICE;
		*DICE    =*(DICE+3);
		*(DICE+3)=*(DICE+5);
		*(DICE+5)=*(DICE+2);
		*(DICE+2)=temp;
		break;
	case 'W':
		temp     =*DICE;
		*DICE    =*(DICE+2);
		*(DICE+2)=*(DICE+5);
		*(DICE+5)=*(DICE+3);
		*(DICE+3)=temp;
		break;
	}
}

Compiler output:
main.c: In function 'main':
main.c:12:5: error: 'j' undeclared (first use in this function)
   12 | for(j=0;j<q;j++){
      |     ^
main.c:12:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
typedef struct Dice{int t,s,e,w,n,b;}dice;
  
void koro(dice *d,char *h){
    dice dbuf;
    dbuf.t=d->t;dbuf.s=d->s;dbuf.e=d->e;dbuf.w=d->w;dbuf.n=d->n;dbuf.b=d->b;
    switch(*h){
        case 'S':
            d->t=dbuf.n;
            d->s=dbuf.t;
            d->e=dbuf.e;
            d->w=dbuf.w;
            d->n=dbuf.b;
            d->b=dbuf.s;
            break;
        case 'E':
            d->t=dbuf.w;
            d->s=dbuf.s;
            d->e=dbuf.t;
            d->w=dbuf.b;
            d->n=dbuf.n;
            d->b=dbuf.e;
            break;
        case 'W':
            d->t=dbuf.e;
            d->s=dbuf.s;
            d->e=dbuf.b;
            d->w=dbuf.t;
            d->n=dbuf.n;
            d->b=dbuf.w;
            break;
        case 'N':
            d->t=dbuf.s;
            d->s=dbuf.b;
            d->e=dbuf.e;
            d->w=dbuf.w;
            d->n=dbuf.t;
            d->b=dbuf.n;
            break;
    }
}
  
int main(void){
    dice di;
    int i,q,dice[7],target_top,target_front;
    for(i=0;i<6;i++)scanf("%d",&dice[i]);
    di.t=dice[0];di.s=dice[1];di.e=dice[2];di.w=dice[3];di.n=dice[4];di.b=dice[5];
    scanf("%d",&q);
    for(i=0;i<q;i++){
        scanf("%d %d",&target_top,&target_front);
        if     (di.s==target_top) koro(&di,"N");
        else if(di.e==target_top) koro(&di,"W");
        else if(di.w==target_top) koro(&di,"E");
        else if(di.n==target_top) koro(&di,"S");
        else if(di.b==target_top){koro(&di,"S");koro(&di,"S");}
 
        if     (di.e==target_front){koro(&di,"W");koro(&di,"S");koro(&di,"E");}
        else if(di.w==target_front){koro(&di,"E");koro(&di,"S");koro(&di,"W");}
        else if(di.n==target_front){koro(&di,"S");koro(&di,"S");koro(&di,"E");koro(&di,"E");}
         
        printf("%d\n",di.e);
    }
    return 0;

Compiler output:
main.c: In function 'main':
main.c:63:5: error: expected declaration or statement at end of input
   63 |     return 0;
      |     ^~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
 
void makecopy(int *saikoro,int *copy){
  int i;
  for(i=1;i<=6;i++){
    copy[i]=saikoro[i];
  }
}


int main(){
  int *saikoro,*copy,i,ue,syoumen,n,j;
  saikoro=malloc(7*sizeof(int));
  copy=malloc(7*sizeof(int));
  for(i=1;i<=6;i++) scanf("%d",&saikoro[i]);
  makecopy(saikoro,copy);
  scanf("%d",&n);
  char order[8]="SSSSEEEE";
  for(j=0;j<n;j++){
    scanf("%d %d",&ue,&syoumen);
    for(i=0;i<strlen(order);i++){
      if(order[i]=='S'){
        saikoro[2]=copy[1];
        saikoro[6]=copy[2];
        saikoro[5]=copy[6];
        saikoro[1]=copy[5];
        makecopy(saikoro,copy);
      }
      if(order[i]=='N'){
        saikoro[1]=copy[2];
        saikoro[2]=copy[6];
        saikoro[6]=copy[5];
        saikoro[5]=copy[1];
        makecopy(saikoro,copy);
      }
      if(order[i]=='W'){
        saikoro[4]=copy[1];
        saikoro[6]=copy[4];
        saikoro[3]=copy[6];
        saikoro[1]=copy[3];
        makecopy(saikoro,copy);
      }
      if(order[i]=='E'){
        saikoro[1]=copy[4];
        saikoro[4]=copy[6];
        saikoro[6]=copy[3];
        saikoro[3]=copy[1];
        makecopy(saikoro,copy);
      }
      if(saikoro[1]==ue) break;
    }
    while(saikoro[2]!=syoumen){
      saikoro[2]=copy[3];
      saikoro[4]=copy[2];
      saikoro[5]=copy[4];
      saikoro[3]=copy[5];
      makecopy(saikoro,copy);
    }
    printf("%d\n",saikoro[3]);
  }
  return

Compiler output:
main.c: In function 'main':
main.c:63:3: error: expected expression at end of input
   63 |   return
      |   ^~~~~~
main.c:63:3: error: expected declaration or statement at end of input
Language: C

#include<iostream>
 
using namespace std;
 
 
class DICE {
    enum {
        Top,
        Front,
        Right,
        Left,
        Rear,
        Bottom
    };
 
public:
    int Num[6];
 
    void Roll(const char*Directions) {
        for (int i = 0; Directions[i] != '\0'; i++) {
            Roll(Directions[i]);
        }
    }
 
    void Roll(const char Direction) {
        int tmpTop = Num[Top];
 
        switch (Direction) {
        case'E':
            Num[Top] = Num[Left];
            Num[Left] = Num[Bottom];
            Num[Bottom] = Num[Right];
            Num[Right] = Num[tmpTop];
            break;
        case'N':
            Num[Top] = Num[Front];
            Num[Front] = Num[Bottom];
            Num[Bottom] = Num[Rear];
            Num[Rear] = tmpTop;
            break;
        case'S':
            Num[Top] = Num[Rear];
            Num[Rear] = Num[Bottom];
            Num[Bottom] = Num[Front];
            Num[Front] = tmpTop;
            break;
        case'W':
            Num[Top] = Num[Right];
            Num[Right] = Num[Bottom];
            Num[Bottom] = Num[Left];
            Num[Left] = tmpTop;
            break;
        }
    }
 
    int TopFrontToRight(const int TopNum, const int FrontNum) {
        const char Directions[][3] = { "N","N","N","NW","WW","\0" };
        DICE Dice;
 
        for (int i = 0; i < 6; i++)Dice.Num[i] = Num[i];
 
        for (int i = 0; i < 6; i++) {
            if (TopNum == Dice.Num[Top]) {
                for (int j = 0; j < 4; j++) {
                    if (FrontNum == Dice.Num[Front])
                        return Dice.Num[Right];
 
                    int tmpFront = Dice.Num[Front];
                    Dice.Num[Front] = Dice.Num[Right];
                    Dice.Num[Right] = Dice.Num[Rear];
                    Dice.Num[Rear] = Dice.Num[Left];
                    Dice.Num[Left] = tmpFront;
                }
            }
 
            Dice.Roll(Directions[i]);
        }
 
        return 0;
    }
};
 
int main() {
    DICE Dice;
    int q;
 
    for (int i = 0; i < 6; i++) {
        cin >> Dice.Num[i];
    }
    cin >> q;
 
    for (int i = 0; i < q; i++) {
        int Top, Front;
         
        cin >> Top >> Front;
 
        cout << Dice.TopFrontToRight(Top, Front) << endl;
    }
 
    return 0;
}

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

#include <map>
#include <iostream>

using namespace std;

class Dice
{

	const static int NUM_S = 6;
	int a[NUM_S];
	map<int, int> men;

public:
	Dice(void) {}

	void set(int _a[]) {
		a[0] = _a[0];
		a[1] = _a[1];
		a[2] = _a[2];
		a[3] = _a[3];
		a[4] = _a[4];
		a[5] = _a[5];
		men[_a[0]] = 0;
		men[_a[1]] = 1;
		men[_a[2]] = 2;
		men[_a[3]] = 3;
		men[_a[4]] = 4;
		men[_a[5]] = 5;
	}

	int que(int x1, int x2) {
		int x = men[x1];
		int y = men[x2];
		switch (x) {
			case 0:
			switch (y) {
				case 1:
					return a[2];
				case 2:
					return a[4];
				case 3:
					return a[1];
				case 4:
					return a[3];
			}
			case 1:
			switch (y) {
				case 0:
					return a[3];
				case 2:
					return a[0];
				case 3:
					return a[5];
				case 5:
					return a[2];
			}
			case 2:
			switch (y) {
				case 0:
					return a[1];
				case 1:
					return a[5];
				case 4:
					return a[0];
				case 5:
					return a[4];
			}
			case 3:
			switch (y) {
				case 0:
					return a[4];
				case 1:
					return a[0];
				case 4:
					return a[5];
				case 5:
					return a[1];
			}
			case 4:
			switch (y) {
				case 0:
					return a[2];
				case 2:
					return a[5];
				case 3:
					return a[0];
				case 5:
					return a[3];
			}
			case 5:
			switch (y) {
				case 1:
					return a[3];
				case 2:
					return a[1];
				case 3:
					return a[4];
				case 4:
					return a[2];
			}
		}
	}

	int rs(void) {
		int tmp = a[1];
		a[1] = a[0]; a[0] = a[4];
		a[4] = a[5]; a[5] = tmp;
		return a[0];
	}

	int re(void) {
		int tmp = a[0];
		a[0] = a[3]; a[3] = a[5];
		a[5] = a[2]; a[2] = tmp;
		return a[0];
	}

	int rn(void) {
		int tmp = a[1];
		a[1] = a[5]; a[5] = a[4];
		a[4] = a[0]; a[0] = tmp;
		return a[0];
	}

	int rw(void) {
		int tmp = a[0];
		a[0] = a[2]; a[2] = a[5];
		a[5] = a[3]; a[3] = tmp;
		return a[0];
	}

};

int main()
{
	Dice dc;
	int st[6];
	cin >> st[0] >> st[1] >> st[2] >> st[3] >> st[4] >> st[5];
	dc.set(st);

	unsigned int n;
	cin >> n;
	for (unsigned int i = 0; i < n; ++i) {
		cin >> x >> y;
		cout << dc.que(x, y) << endl;
	}

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:144:24: error: 'x' was not declared in this scope
  144 |                 cin >> x >> y;
      |                        ^
a.cc:144:29: error: 'y' was not declared in this scope
  144 |                 cin >> x >> y;
      |                             ^
Language: C++

#include <cstdio>

int face[6];
int times,a,b;
int check[6][5];


int main(){
	
	for(int i=0; i<6; ++i){
		scanf("%d", &face[i]);
	}
	
	check = {
		{face[1],face[2],face[4],face[3],face[1]},
		{face[5],face[2],face[0],face[3],face[5]},
		{face[5],face[4],face[0],face[1],face[5]},
		{face[5],face[1],face[0],face[4],face[5]},
		{face[5],face[3],face[0],face[2],face[5]},
		{face[4],face[2],face[1],face[3],face[4]}
	};
	
	scanf("%d", &times);
	
	for(int i=0; i<times; ++i){
		scanf("%d %d", &a, &b);
		for(int j=0; j<6; ++j){
			if(a == face[j]){
				for(int k=0; k<5; ++k){
					if(b == check[j][k]){
						printf("%d", check[j][k+1]);
						continue;
					}
				}
			}
		}
	}
	
	
	
	
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: error: assigning to an array from an initializer list
   14 |         check = {
      |         ~~~~~~^~~
   15 |                 {face[1],face[2],face[4],face[3],face[1]},
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   16 |                 {face[5],face[2],face[0],face[3],face[5]},
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   17 |                 {face[5],face[4],face[0],face[1],face[5]},
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   18 |                 {face[5],face[1],face[0],face[4],face[5]},
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   19 |                 {face[5],face[3],face[0],face[2],face[5]},
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   20 |                 {face[4],face[2],face[1],face[3],face[4]}
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   21 |         };
      |         ~
Language: C++

#include <iostream>
#include <string>

class Dice{
    public:
    int a[7];//-,up,flont,right,left,back,down
    void roll(char d);
    void rotate(void);
};

void Dice::rotate(void){
    tmp=a[2];
    a[2]=a[3];
    a[3]=a[5];
    a[5]=a[4];
    a[4]=tmp;
}

void Dice::roll(char d){
    int tmp;
    if(d=='N'){
        tmp=a[1];
        a[1]=a[2];
        a[2]=a[6];
        a[6]=a[5];
        a[5]=tmp;
    }
    else if(d=='S'){
        tmp=a[1];
        a[1]=a[5];
        a[5]=a[6];
        a[6]=a[2];
        a[2]=tmp;
    }
    else if(d=='W'){
        tmp=a[1];
        a[1]=a[3];
        a[3]=a[6];
        a[6]=a[4];
        a[4]=tmp;
    }
    else if(d=='E'){
        tmp=a[1];
        a[1]=a[4];
        a[4]=a[6];
        a[6]=a[3];
        a[3]=tmp;
    }
}

int main(void){
    int i,n;
    Dice dice;
    
    for(i=1;i<7;i++){
        std::cin>>dice.a[i];
    }
    
    int c;
    for(i=0;i<n;i++){
        std::cin>>u>>f;
        c=0;
        while(dice.a[1]!=u){
            if(c%2==0){
                dice.roll('N');
            }
            else{
                dice.roll('W');
            }
        }
        while(dice.a[2]!=f){
            dice.rotate(void);
        }
        std::cout<<dice.a[3]<<std::endl;
    }
    return 0;
}


Compiler output:
a.cc: In member function 'void Dice::rotate()':
a.cc:12:5: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   12 |     tmp=a[2];
      |     ^~~
      |     tm
a.cc: In function 'int main()':
a.cc:61:19: error: 'u' was not declared in this scope
   61 |         std::cin>>u>>f;
      |                   ^
a.cc:61:22: error: 'f' was not declared in this scope
   61 |         std::cin>>u>>f;
      |                      ^
a.cc:72:25: error: expected primary-expression before 'void'
   72 |             dice.rotate(void);
      |                         ^~~~
Language: C++

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

class Dice{
private:
  int tmp;
public:
  int q[6];
  void roll(char d){
    if(d=='N'){
      tmp = q[4];
      q[4] = q[0];
      q[0] = q[1];
      q[1] = q[5];
      q[5] = tmp;
    } else if(d=='E'){
      tmp = q[2];
      q[2] = q[0];
      q[0] = q[3];
      q[3] = q[5];
      q[5] = tmp;
    } else if(d=='W'){
      tmp = q[3];
      q[3] = q[0];
      q[0] = q[2];
      q[2] = q[5];
      q[5] = tmp;
    } else if(d=='S'){
      tmp = q[1];
      q[1] = q[0];
      q[0] = q[4];
      q[4] = q[5];
      q[5] = tmp;
    }
  }
};


int main(){
  Dice d;
  for(int i=0; i<6; i++){
    cin >> d.q[i];
  }
  int n;
  int a, b;
  int r;
  cin >> n;
  for(int i=0; i<n; i++){
    cin >> a >> b;
    while(d.q[0]!=a||d.q[1]!=b){
      r = rand()%4;
      if(r==0)d.roll('N');
      else if(r==1)d.roll('E');
      else if(r==2)d.roll('W');
      else if(r==3)d.roll('S');
    }
    cout << d.q[2] << endl;
  }
}




Compiler output:
a.cc:2:10: fatal error: crandom: No such file or directory
    2 | #include <crandom>
      |          ^~~~~~~~~
compilation terminated.
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;
  }
};

int getRight(Cube c1,int f1,int f2){
    for(int i=0;i<6;i++){
        for(int j=0;j<4;j++){
            if(c1.f[0]==f1&&c1.f[1]==f2)return c1.f[2];
            c1.roll_z();
        }
        if(i%2==0)c1.roll_y();
        else c1.roll_x();
    }
    return -1;
}

int main(){
    Cube c;
    int f1,f2;
    
    for(int i=0;i<6;i++)cin>>c.f[i];
    int q; cin>>q;
    
    for(int i=0;i<q;i++){
        cin>>f1>>f2;
        cout<<getRight(c,f1,f2)<<endl;
    }
    return 0;
}


Compiler output:
a.cc:40:2: error: expected '}' at end of input
   40 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | class Cube{
      |           ^
a.cc: In constructor 'Cube::Cube()':
a.cc:8:16: error: a function-definition is not allowed here before '{' token
    8 |   void roll_z(){roll(1,2,4,3);}
      |                ^
a.cc:9:16: error: a function-definition is not allowed here before '{' token
    9 |   void roll_y(){roll(0,2,5,3);}
      |                ^
a.cc:10:16: error: a function-definition is not allowed here before '{' token
   10 |   void roll_x(){roll(0,1,5,4);}
      |                ^
a.cc:11:37: error: a function-definition is not allowed here before '{' token
   11 |   void roll(int i,int j,int k,int l){
      |                                     ^
a.cc: In member function 'int Cube::getRight(Cube, int, int)':
a.cc:20:16: error: 'class Cube' has no member named 'roll_z'
   20 |             c1.roll_z();
      |                ^~~~~~
a.cc:22:22: error: 'class Cube' has no member named 'roll_y'
   22 |         if(i%2==0)c1.roll_y();
      |                      ^~~~~~
a.cc:23:17: error: 'class Cube' has no member named 'roll_x'
   23 |         else c1.roll_x();
      |                 ^~~~~~
a.cc: At global scope:
a.cc:40:2: error: expected unqualified-id at end of input
   40 | }
      |  ^
Language: C++

#include <iostream>
using namespace std;

class dice{
  
public:
  int _1,_2,_3,_4,_5,_6,sus;

  void moveN(){:
    sus=d._1;
    d._1=d._2;
    d._2=d._6;
    d._6=d._5;
    d._5=sus;
  }

  void moveE(){
    sus=d._1;
    d._1=d._4;
    d._4=d._6;
    d._6=d._3;
    d._3=sus;
  }

  void moveW(){
    sus=d._1;
    d._1=d._3;
    d._3=d._6;
    d._6=d._4;
    d._4=sus;
  }

  void moveS(){
    sus=d._1;
    d._1=d._5;
    d._5=d._6;
    d._6=d._2;
    d._2=sus;
  }
  
  void spin(){
    sus=_2;
    _2=_3;
    _3=_5;
    _5=_4;
    _4=sus;
  }
  
};

int main(){
  
  dice d1;

  int dir_t,i,T,F;

  cin>>d1._1>>d1._2>>d1._3>>d1._4>>d1._5>>d1._6;
  cin>>dir_t;

  for(i=0; i<dir_t; i++){

    cin>>T>>F;
    
    if(d1._3==T||d1._4==T)d1.moveE();
    while(d1._1!=T)d1.moveN();
    while(d1._2!=F)d1.spin();
    
    cout<<d1._3<<endl;
    
  }

  return 0;

}

Compiler output:
a.cc: In member function 'void dice::moveN()':
a.cc:9:16: error: expected primary-expression before ':' token
    9 |   void moveN(){:
      |                ^
a.cc:11:5: error: 'd' was not declared in this scope
   11 |     d._1=d._2;
      |     ^
a.cc: In member function 'void dice::moveE()':
a.cc:18:9: error: 'd' was not declared in this scope
   18 |     sus=d._1;
      |         ^
a.cc: In member function 'void dice::moveW()':
a.cc:26:9: error: 'd' was not declared in this scope
   26 |     sus=d._1;
      |         ^
a.cc: In member function 'void dice::moveS()':
a.cc:34:9: error: 'd' was not declared in this scope
   34 |     sus=d._1;
      |         ^
Language: C++

#include <iostream>
#include <string>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

struct Cube
{
	int f[6];
	Cube(){}

	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 roll_z() { roll(1,2,4,3); }
	void roll_y() { roll(0,2,5,3); }
	void roll_x() { roll(0,1,5,4); }

	void move(char c)
	{
		if(c == 'E') rep(i,3) roll_y();
		else if(c == 'W') roll_y();
		else if(c == 'N') roll_x();
		else if(c == 'S') rep(i,3) roll_x();
	}
};

int getRight(Cube c,int a,int b)
{
	rep(i,6)
	{
		rep(j,4)
		{
			if(c.f[0] == a && c.f[1] == b)
			{
				return c.f[2];
			}
			c.roll_z();
		}
		if(i%2 == 0) c.roll_y();
		else c.roll_x();
	}

	return -1;
}

int main_itp1_11_b()
{
	Cube c;
	int n;
	rep(i,6) cin >> c.f[i];
	cin >> n;

	rep(k,n)
	{
		int a,b;
		cin >> a >> b;
		cout << getRight(c,a,b) << endl;
	}
	return 0;
}

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 <string>

using namespace std;

class Dice
{
public:
	Dice(unsigned int in[6])
	{
		for (int i = 0; i < 6; i++)
		{
			label[i] = in[i];
			//cout << "label[" << i << "]=" << label[i];
		}
		//cout << endl;
		Reset();
	}
	~Dice()
	{
	}
	void Reset()
	{
		N = 5;
		E = 3;
		S = 2;
		W = 4;
		F = 1;
		B = 6;
	}
	void Run(string &cmd)
	{
		for (int i = 0; i < cmd.size(); i++)
		{
			char c = cmd[i];
			if (c == 'S')
			{
				// 3, 4?????????????????????
				int tmpF = F;
				F = N;
				N = B;
				B = S;
				S = tmpF;
			}
			else if (c == 'N')
			{
				// 3, 4?????????????????????
				int tmpN = N;
				N = F;
				F = S;
				S = B;
				B = tmpN;
			}
			else if (c == 'E')
			{
				// 2,5?????????????????????
				int tmpB = B;
				B = E;
				E = F;
				F = W;
				W = tmpB;
			}
			else if (c == 'W')
			{
				int tmpW = W;
				W = F;
				F = E;
				E = B;
				B = tmpW;
			}
		}
	}
	int GetFront()
	{
		return F;
	}
	int GetLabel()
	{
		return label[F-1];
	}
	int GetSouthLabel()
	{
		return label[S-1];
	}
	// ?????°??????????????§N?????????W????????????
	int ThrowTo(int argF, int argS)
	{
		//cout << "DEBUG:Begin ThrowTo(int argF, int argS)" << endl;
		for (int x = 0; x < 4; x++)
		{
			Reset(); // TODO ?????????4??????!!!
			if (x == 0)
			{
			}
			else if (x == 1)
			{
				string cmd1 = "WSE";
				Run(cmd1);
			}
			else if (x == 2)
			{
				string cmd2 = "WSSE";
				Run(cmd2);
			}
			else if (x == 3)
			{
				string cmd3 = "WSSSE";
				Run(cmd3);
			}
			for (int w = 0; w < 4; w++)
			{
				for (int n = 0; n < 4; n++)
				{
					string nnnn = "N";
					Run(nnnn);
					//printf("inArg(%d,%d)   dice[%d,%d]\n", argF, argS, GetLabel(), GetSouthLabel());
					if (GetLabel() == argF && GetSouthLabel() == argS)
					{
						//cout << "HIT:" << label[E-1] << endl;
						return label[E-1];
					}
				}
				String wwww = "W";
				Run(wwww);
			}
		}
		return 1;
	}
private:
	unsigned int label[6];
	int N;
	int E;
	int S;
	int W;
	int F;
	int B;
};

int main()
{
	unsigned int in[6] = {0};
	unsigned int n;
	unsigned int q;
	string cmd;
	for (int i = 0; i < 6; i++)
	{
		cin >> n;
		in[i] = n;
	}
	cin >> q;
	for (int i = 0; i < q; i++)
	{
		int front, south;
		cin >> front >> south;
		
		// ?????´(East)?????¨????????????
		Dice d1(in);
		cout << d1.ThrowTo(front, south) << endl;
	}
	
	/*
	unsigned int in[6] = {1, 2, 3, 4, 5, 6};
	Dice d1(in);
	d1.ThrowTo(6, 5);
	*/
	
	return 0;
}

Compiler output:
a.cc: In member function 'int Dice::ThrowTo(int, int)':
a.cc:123:33: error: 'String' was not declared in this scope
  123 |                                 String wwww = "W";
      |                                 ^~~~~~
a.cc:124:37: error: 'wwww' was not declared in this scope
  124 |                                 Run(wwww);
      |                                     ^~~~
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, 7)} // to W
 void roll_x(){ roll(0, 1, 5, 4)} // to N
 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;
 }
};

int getRight(Cube c1, int f1, int f2){
 for(int i = 0; i < 6; i++){
  for(int j = 0; j < 4; j++){
   if(c1.f[0] == f1 && c1.f[1] == f2) 
    return c1.f[2];
   c1.roll_z();
  }
  if(i % 2 == 0) c1.roll_y();
  else c1.roll_x();
 }
 return -1;
}

int main(){
 Cube c;
 int f1,f2;

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

 for(int i = 0; i < q; i++){
  cin >> f1 >> f2;
  cout << getRight(c, f1, f2) << endl;
 }

 return 0;
}

Compiler output:
a.cc: In member function 'void Cube::roll_z()':
a.cc:9:33: error: expected ';' before '}' token
    9 |  void roll_z(){ roll(1, 2, 4, 3)} //
      |                                 ^
a.cc: In member function 'void Cube::roll_y()':
a.cc:10:33: error: expected ';' before '}' token
   10 |  void roll_y(){ roll(0, 2, 5, 7)} // to W
      |                                 ^
a.cc: In member function 'void Cube::roll_x()':
a.cc:11:33: error: expected ';' before '}' token
   11 |  void roll_x(){ roll(0, 1, 5, 4)} // to N
      |                                 ^
Language: C++

#include <iostream>
using namespace std;

int D[6];
void spin(char c)
{
    if(c=='E'){
        swap(D[0],D[3]);swap(D[3],D[5]);swap(D[5],D[2]);
    }
    else if(c=='W'){
        swap(D[0],D[2]);swap(D[2],D[5]);swap(D[5],D[3]);
    }
    else if(c=='S'){
        swap(D[0],D[1]);swap(D[0],D[4]);swap(D[4],D[5]);
    }
    else if(c=='N'){
        swap(D[0],D[1]);swap(D[1],D[5]);swap(D[5],D[4]);
    }
}


int main()
{
    int q,a,b;
    char SWS[10]={"SSSSWSSSS"};
    for(int i=0;i<6;i++)cin>>D[i];
    cin>>q;
    for(int i=0;i<q;i++){
        cin>>a>>b;
        for(int i=0;i<10;i++){
            if(D[1]==b)break;
            spin(SWS[i]);
        }
        for(int i=0;i<4;i++){
            if(D[0]==a){
                cout<<D[2]<<endl;
                break;
            }
            spin('W');
        }
    }

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

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

using namespace std;

int r[6][6] = {
	{ -1, 3, 5, 2, 4, 0 }, { 4, -1, 1, 6, 0, 3 }, { 2, 6, -1, 0, 1, 5 },
	{ 5, 1, 0, -1, 6, 2 }, { 3, 0, 6, 1, -1, 4 }, { 0, 4, 2, 5, 3, -1 }
};

int main()
{
	vector<int> d(6);

	for (int i = 0; i < d.size(); ++i)
		cin >> skipws >> d[i];

	string ans;
	int q;
	cin >> q;

	while (q--)
	{
		int f, t;
		cin >> t >> f;

		vector<int>::iterator itt, itf;
		itt = find(d.begin(), d.end(), t);
		itf = find(d.begin(), d.end(), f);
		t = itt - d.begin();
		f = itf - d.begin();
		ans += to_string(r[t][f]) + "\n";
	}

	cout << ans;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:27: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   29 |                 itt = find(d.begin(), d.end(), t);
      |                       ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:29:27: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   29 |                 itt = find(d.begin(), d.end(), t);
      |                       ~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:30:27: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   30 |                 itf = find(d.begin(), d.end(), f);
      |                       ~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:30:27: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   30 |                 itf = find(d.begin(), d.end(), f);
      |                       ~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

using namespace std;

int r[6][6] = {
	{ -1, 3, 5, 2, 4, 0 }, { 4, -1, 1, 6, 0, 3 }, { 2, 6, -1, 0, 1, 5 },
	{ 5, 1, 0, -1, 6, 2 }, { 3, 0, 6, 1, -1, 4 }, { 0, 4, 2, 5, 3, -1 }
};

int main()
{
	vector<int> d(6);

	for (int i = 0; i < d.size(); ++i)
		cin >> skipws >> d[i];

	string ans;
	int q;
	cin >> q;

	while (q--)
	{
		int f, t;
		cin >> t >> f;

		//vector<int>::iterator itt, itf;
		auto itt = find(d.begin(), d.end(), t);
		auto itf = find(d.begin(), d.end(), f);
		t = itt - d.begin();
		f = itf - d.begin();
		ans += to_string(r[t][f]) + "\n";
	}

	cout << ans;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:32: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   29 |                 auto itt = find(d.begin(), d.end(), t);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:29:32: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   29 |                 auto itt = find(d.begin(), d.end(), t);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:30:32: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   30 |                 auto itf = find(d.begin(), d.end(), f);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:30:32: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   30 |                 auto itf = find(d.begin(), d.end(), f);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include<string>
#include<conio.h>

using namespace std;
class Dice{
public:
	int num[6],t;//t=top


	void North(){
		t = num[0];
		num[0] = num[1];//??????1?????¨???
		num[1] = num[5];//??????2?????¨???
		num[5] = num[4];//??????6?????¨???
		num[4] = t;//??????5?????¨???
		}

	void East(){
		t = num[0];
		num[0] = num[3];//??????1?????¨???
		num[3] = num[5];//??????4?????¨???
		num[5] = num[2];//??????6?????¨???
		num[2] = t;//??????3?????¨???
		}


	void South(){
		t = num[0];
		num[0] = num[4];//??????1?????¨???
		num[4] = num[5];//??????5?????¨???
		num[5] = num[1];//??????6?????¨???
		num[1] = t;//??????2?????¨???
		}

	void West(){
		t = num[0];
		num[0] = num[2];//??????1?????¨???
		num[2] = num[5];//??????3?????¨???
		num[5] = num[3];//??????6?????¨???
		num[3] = t;//??????3?????¨???
		}

};

int main()
{
	int q,i;

	Dice dice;
	int num[6];
	cin >> dice.num[i];

	dice.num[0] = num[0];
	dice.num[1] = num[1];
	dice.num[2] = num[2];
	dice.num[3] = num[3];
	dice.num[4] = num[4];
	dice.num[5] = num[5];

	cin >> q;
	for (i = 0; i < q; i++) {
		int a,b;//ue to mae
		cin >> a >> b;

		//mae ?????°???
		if (b == dice.num[0]) {//mae 1
			dice.South();
		}
		else if(b == dice.num[2]){//mae 3
			dice.West();
			dice.South();
		}
		else if (b == dice.num[3]){
				dice.East();
				dice.South();
		}
		else if(b == dice.num[4]){
				dice.South();
				dice.South();
		}
		else if (b == dice.num[5]) {
				dice.North();
			 }
		//ue ?????°???
		if(a == dice.num[2]){
			dice.West();
		}
		else if(dice.num[3]){
			dice.East();
		}
		else if(dice.num[5]){
			dice.West();
			dice.West();
		}

		cout << dice.num[2] <<endl;
		}
        getch();
		return 0;
}

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

#include<iostream>
using namespace std;

class Dice{
	int _num[6];
	public:
		void set(int num[6]){
			for(int i = 0; i < 6; i++) _num[i] = num[i];
		}
		void N(){
			swap(_num[0],_num[4]);
			swap(_num[0],_num[5]);
			swap(_num[0],_num[1]);
		}
		void S(){
			swap(_num[0],_num[1]);
			swap(_num[0],_num[5]);
			swap(_num[0],_num[4]);
		}
		void W(){
			swap(_num[0],_num[3]);
			swap(_num[0],_num[5]);
			swap(_num[0],_num[2]);
		}
		void E(){
			swap(_num[0],_num[2]);
			swap(_num[0],_num[5]);
			swap(_num[0],_num[3]);
		}
		void printTop(){
			cout << _num[0] << endl;
		}
		void printRight(){
			cout << _num[2] << endl;
		}
		void SetTop(int n){
			if(_num[2] == n) W();
			else if(_num[3] == n) E();
			else{
				while(1){
					if(_num[0] == 0) break;
					S();
				}
			}
		}
		void setFront(int n){
			while(1){
				if(_num[1] == n) break;
				S(); W(); N();
			}
		}
};

int main(){
	int num[6];
	for(int i = 0; i < 6; i++) 
		cin >> num[i];
	
	Dice d;
	d.set(num);
	
	int q;
	cin >> q;
	
	for(int i = 0; i < q; i++){
		int top,front;
		cin >> top >> front;
		
		d.SetTop(top);
		d.SetFront(front);
		
		d.printRight();
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:19: error: 'class Dice' has no member named 'SetFront'; did you mean 'setFront'?
   70 |                 d.SetFront(front);
      |                   ^~~~~~~~
      |                   setFront
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();
	int getTop();
	int getS();
	int getE();
	int getW();
	int getN();
	int getBottom();

	void show();

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


int main(void){
	int surface[NUM_S];
	int q, top, front;
	
	for (int i = 0; i < NUM_S; i++) {
		cin >> surface[i];
	}

	Dice dice(surface);

	cin >> q;

	for (int i = 0; i < q; i++) {
		cin >> top >> front;
		if (dice.getE == top || dice.getW == top) dice.rollE;
		while (dice.rollS() != top) {	}
		while (dice.getS() != front) {
			dice.rollE();
		}
		cout << dice.getE() << "\n";
	}

	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') {
		return rollS();
	}
	else if (c == 'E') {
		return rollE();
	}
	else if (c == 'W') {
		return rollW();
	}
	else if (c == 'N') {
		return 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;
}


int Dice::getTop() {
	return top;
}

int Dice::getS() {
	return south;
}

int Dice::getE() {
	return east;
}


int Dice::getW() {
	return west;
}


int Dice::getN() {
	return north;
}


int Dice::getBottom() {
	return bottom;
}


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

Compiler output:
a.cc: In function 'int main()':
a.cc:44:26: error: invalid use of member function 'int Dice::getE()' (did you forget the '()' ?)
   44 |                 if (dice.getE == top || dice.getW == top) dice.rollE;
      |                     ~~~~~^~~~
      |                              ()
a.cc:44:46: error: invalid use of member function 'int Dice::getW()' (did you forget the '()' ?)
   44 |                 if (dice.getE == top || dice.getW == top) dice.rollE;
      |                                         ~~~~~^~~~
      |                                                  ()
a.cc:44:64: error: invalid use of non-static member function 'int Dice::rollE()'
   44 |                 if (dice.getE == top || dice.getW == top) dice.rollE;
      |                                                           ~~~~~^~~~~
a.cc:12:13: note: declared here
   12 |         int rollE();
      |             ^~~~~
a.cc: In member function 'int Dice::roll(char)':
a.cc:78:1: warning: control reaches end of non-void function [-Wreturn-type]
   78 | }
      | ^