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

typedef struct dice {

	int num[6];

}dice;

void mov(struct dice *d, char c[], int len);

int main(void) {

	dice dice1;
	int i = 0;
	char c[101];
	int len;

	for(i = 0; i < 6; i++)
		dice1.num[i] = {};

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

	scanf("%s", c);

	len = strlen(c);

	mov(&dice1, c, len);

	printf("%d\n", dice1.num[0]);

	return 0;
}

void mov(struct dice *d, char c[], int len) {
	int tmp = 0;
	int i = 0;

	for (i = 0; i < len; i++) {
		if ('E' == c[i]) {
			tmp = (*d).num[0];
			(*d).num[0] = (*d).num[3];
			(*d).num[3] = (*d).num[5];
			(*d).num[5] = (*d).num[2];
			(*d).num[2] = tmp;
		}
		else if ('N' == c[i]) {
			tmp = (*d).num[0];
			(*d).num[0] = (*d).num[1];
			(*d).num[1] = (*d).num[5];
			(*d).num[5] = (*d).num[4];
			(*d).num[4] = tmp;
		}
		else if ('S' == c[i]) {
			tmp = (*d).num[0];
			(*d).num[0] = (*d).num[4];
			(*d).num[4] = (*d).num[5];
			(*d).num[5] = (*d).num[1];
			(*d).num[1] = tmp;
		}
		else if ('W' == c[i]) {
			tmp = (*d).num[0];
			(*d).num[0] = (*d).num[2];
			(*d).num[2] = (*d).num[5];
			(*d).num[5] = (*d).num[3];
			(*d).num[3] = tmp;
		}
	}
}

Compiler output:
main.c: In function 'main':
main.c:17:32: error: expected expression before '{' token
   17 |                 dice1.num[i] = {};
      |                                ^
main.c:20:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   20 |                 scanf("%d", &dice1.num[i]);
      |                 ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | typedef struct dice {
main.c:20:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   20 |                 scanf("%d", &dice1.num[i]);
      |                 ^~~~~
main.c:20:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:22:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   22 |         scanf("%s", c);
      |         ^~~~~
main.c:22:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:24:15: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   24 |         len = strlen(c);
      |               ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
  +++ |+#include <string.h>
    1 | typedef struct dice {
main.c:24:15: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   24 |         len = strlen(c);
      |               ^~~~~~
main.c:24:15: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:28:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   28 |         printf("%d\n", dice1.num[0]);
      |         ^~~~~~
main.c:28:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:28:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:28:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main(void){
    int i,num,sum;
    double hansamu,bunsan,ave,hensa;
    int *a;
    while(1){
            hen = 0;
            sum = 0;
        scanf("%d",&num);
        if(num == 0) break;
        a = (int *)malloc(sizeof(int) * num);
        for(i = 0;i<num;i++){
            scanf("%d",&a[i]);
            sum += a[i];
        }
        ave = (double) sum / num;
        for(i=0;i<num;i++){
            hansamu = hansamu + pow(a[i]-ave,2);
        }
        bunsan = (double)(hansamu / num);
        hensa = sqrt(bunsan);
        printf("%f\n",hensa);
        free(a);
    }
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:13: error: 'hen' undeclared (first use in this function); did you mean 'hensa'?
    9 |             hen = 0;
      |             ^~~
      |             hensa
main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C


#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
int main(void){
    int a[6];
    char ope[100];
    int i,oplen,tmp;
    for(i = 0;i<6;i++){
        scanf("%d",&a[i]);
    }
    scanf("%s",ope);
    oplen = strlen(ope);
    for(i=0;i<oplen;i++){
        swith(ope[i]){
        case 'E' : tmp = a[0];
                    a[0] = a[3];
                    a[3] = a[5];
                    a[5] = a[2];
                    a[2] = tmp;
                    break;
        case 'W' : tmp = a[0];
                    a[0] = a[2];
                    a[2] = a[5];
                    a[5] = a[3];
                    a[3] = tmp;
                    break;
        case 'N' : tmp = a[0];
                    a[0] = a[1];
                    a[1] = a[5];
                    a[5] = a[4];
                    a[4] = tmp;
                    break;
        case 'S' : tmp = a[0];
                    a[0] = a[4];
                    a[4] = a[5];
                    a[5] = a[1];
                    a[1] = tmp;
                    break;
        }
    }
    printf("%d\n",a[0]);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:9: error: implicit declaration of function 'swith' [-Wimplicit-function-declaration]
   16 |         swith(ope[i]){
      |         ^~~~~
main.c:16:22: error: expected ';' before '{' token
   16 |         swith(ope[i]){
      |                      ^
      |                      ;
Language: C

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
int main(void){
    int a[6];
    char ope[100];
    int i,oplen,tmp;
    for(i = 0;i<6;i++){
        scanf("%d",&a[i]);
    }
    scanf("%s",ope);
    oplen = strlen(ope);
    for(i=0;i<oplen;i++){
        swith(ope[i]){
        case 'E' : tmp = a[0];
                    a[0] = a[3];
                    a[3] = a[5];
                    a[5] = a[2];
                    a[2] = tmp;
                    break;
        case 'W' : tmp = a[0];
                    a[0] = a[2];
                    a[2] = a[5];
                    a[5] = a[3];
                    a[3] = tmp;
                    break;
        case 'N' : tmp = a[0];
                    a[0] = a[1];
                    a[1] = a[5];
                    a[5] = a[4];
                    a[4] = tmp;
                    break;
        case 'S' : tmp = a[0];
                    a[0] = a[4];
                    a[4] = a[5];
                    a[5] = a[1];
                    a[1] = tmp;
                    break;
        }
    }
    printf("%d\n",a[0]);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:9: error: implicit declaration of function 'swith' [-Wimplicit-function-declaration]
   15 |         swith(ope[i]){
      |         ^~~~~
main.c:15:22: error: expected ';' before '{' token
   15 |         swith(ope[i]){
      |                      ^
      |                      ;
Language: C

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


int main(void){
	int i,j=1,dice1[5],temp;
	char dir[100];
	
	
	
	for(i=0;i<6;i++){
	scanf("%d",&dice2[i]);}
	
	scanf("%s",&dic[100]);
	
	do{
		if(dic[j] =='E'){
		temp = dice2[0];
		dice1[0] = dice2[3];
		dice1[3] = dice2[5];
		dice1[5] = dice2[2];
		dice1[2] = temp;
		if(dic[j] =='S'){
		temp = n[0];
		dice1[0] = dice2[4];
		dice1[4] = dice2[5];
		dice1[5] = dice2[1];
		dice1[1] = temp;
		if(dic[j] =='W'){
		temp =dice2[0];
		dice1[0] = dice2[2];
		dice1[2] = dice2[5];
		dice1[5] = dice2[3];
		dice1[3] = temp;
		if(dic[j] =='N'){
		temp = dice2[0];
		dice1[0] = dice2[1];
		dice1[1] = dice2[5];
		dice1[5] = dice2[4];
		dice1[4] = temp;
		j++;
	}while(dir[j] ='\0');
	
	printf("%d",dice1[0]);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:21: error: 'dice2' undeclared (first use in this function); did you mean 'dice1'?
   12 |         scanf("%d",&dice2[i]);}
      |                     ^~~~~
      |                     dice1
main.c:12:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:21: error: 'dic' undeclared (first use in this function); did you mean 'dir'?
   14 |         scanf("%s",&dic[100]);
      |                     ^~~
      |                     dir
main.c:24:24: error: 'n' undeclared (first use in this function)
   24 |                 temp = n[0];
      |                        ^
main.c:46:1: error: expected declaration or statement at end of input
   46 | }
      | ^
main.c:46:1: error: expected declaration or statement at end of input
main.c:46:1: error: expected declaration or statement at end of input
main.c:46:1: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>



  struct Dice {
    int dice_1;
    int dice_2;
    int dice_3;
    int dice_4;
    int dice_5;
    int dice_6;
  };

  void direct(char c, struct Dice *d) {
    int tmp;

    switch(c) {
      case 'N':
        tmp = d->dice_1;
        d->dice_1 = d->dice_2;
        d->dice_2 = d->dice_6;
        d->dice_6 = d->dice_5;
        d->dice_5 = tmp;
        break;
      case 'W':
        tmp = d->dice_1;
        d->dice_1 = d->dice_3;
        d->dice_3 = d->dice_6;
        d->dice_6 = d->dice_4;
        d->dice_4 = tmp;
        break;
      case 'S':
        tmp = d->dice_1;
        d->dice_1 = d->dice_5;
        d->dice_5 = d->dice_6;
        d->dice_6 = d->dice_2;
        d->dice_2 = tmp;
        break;
      case 'E':
        tmp = d->dice_1;
        d->dice_1 = d->dice_4;
        d->dice_4 = d->dice_6;
        d->dice_6 = d->dice_3;
        d->dice_4 = tmp;
        break;
    }
    return;
  }

int main() {
  int n = 0;
  struct Dice dice;
  scanf("%d%d", &dice.dice_1, &dice.dice_2);
  scanf("%d%d", &dice.dice_3, &dice.dice_4);
  scanf("%d%d\n", &dice.dice_5, &dice.dice_6);

  char c [100];

  scanf("%s", c);

  for (int i = 0; i < 100; i++) {
    if (c[i] == '\0')
      break;
    n++;
  }

  for (i = 0; i < n; i++) {
    direct(c[i], &dice);
  }

  printf("%d\n", dice.dice_1);
  return 0;

}

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


 
#include <iostream>
#include <string>
using namespace std;
 
class Dice{
private:
    int d[6];
public:
    Dice(int n0, int n1, int n2, int n3, int n4, int n5){ //Constructor
        d[0]=n0; d[1]=n1; d[2]=n2; d[3]=n3; d[4]=n4; d[5]=n5;
    }
    int get_top(){
        return d[0];
    }
    void Roll(){
        string op;
        cin >> op;
        for(unsigned int i=0;i<op.length();i++){
            switch(op[i]){
                case 'N': RollN(); break;
                case 'E': RollE(); break;
                case 'W': RollW(); break;
                case 'S': RollS(); break;
            }
        }
    }
    void RollN(){
        int tmp=d[0];
        d[0]=d[1];
        d[1]=d[5];
        d[5]=d[4];
        d[4]=tmp;
    }
    void RollE(){
        int tmp=d[0];
        d[0]=d[3];
        d[3]=d[5];
        d[5]=d[2];
        d[2]=tmp;
    }
    void RollW(){
        int tmp=d[0];
        d[0]=d[2];
        d[2]=d[5];
        d[5]=d[3];
        d[3]=tmp;
    }
    void RollS(){
        int tmp=d[0];
        d[0]=d[4];
        d[4]=d[5];
        d[5]=d[1];
        d[1]=tmp;
    }
};
 
int main(){
    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    Dice di(a, b, c, d, e, f);
    di.Roll();
    cout << di.get_top() << endl;
    return 0;
}
 

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

#include <stdio.h>
int main(void){
    int i,N[7],a,b,c,t;
    char s[101];
    for(i=1;i<7;i++)scanf("%d",&N[i]);
    gets(s);
    gets(s);
    for(a=1,b=2,c=3,i=0;s[i];i++){
        switch(s[i]){
            case'N':t=a,a=b,b=7-t;break;
            case'E':t=c,c=a,a=7-t;break;
            case'S':t=b,b=a,a=7-t;break;
            case'W':t=a,a=c,c=7-t;break;
        }
    }
    printf("%d\n",N[a]);
}

Compiler output:
main.c: In function 'main':
main.c:6:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    6 |     gets(s);
      |     ^~~~
      |     fgets
Language: C

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

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_z(){ 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;
  char com;

  for (int i = 0; i <6; i++ ) scanf ( "%d", c.f[i] );

  scanf("%s", com);

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

  printf("%d\n", f[0]);

  return 0;
}

Compiler output:
main.c:4:1: error: unknown type name 'class'
    4 | class Cube{
      | ^~~~~
main.c:4:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    4 | class Cube{
      |           ^
main.c: In function 'main':
main.c:23:3: error: unknown type name 'Cube'
   23 |   Cube c;
      |   ^~~~
main.c:26:46: error: request for member 'f' in something not a structure or union
   26 |   for (int i = 0; i <6; i++ ) scanf ( "%d", c.f[i] );
      |                                              ^
main.c:30:27: error: request for member 'size' in something not a structure or union
   30 |   for ( int i = 0; i < com.size(); i++ ) c.move(com[i]);
      |                           ^
main.c:30:43: error: request for member 'move' in something not a structure or union
   30 |   for ( int i = 0; i < com.size(); i++ ) c.move(com[i]);
      |                                           ^
main.c:30:52: error: subscripted value is neither array nor pointer nor vector
   30 |   for ( int i = 0; i < com.size(); i++ ) c.move(com[i]);
      |                                                    ^
main.c:32:18: error: 'f' undeclared (first use in this function)
   32 |   printf("%d\n", f[0]);
      |                  ^
main.c:32:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

class dice{
public:
    explicit dice(int in[6]){
        for(int i=0;i<6;i++){
            v[i]=in[i];
        }
    }
    void mov(const char c){
        int buf;
        switch(c){
            case 'N':{
                buf = v[0];
                v[0] = v[1];
                v[1] = v[5];
                v[5] = v[4];
                v[4] = buf;
                break;
            }
            case 'E':{
                buf = v[0];
                v[0] = v[3];
                v[3] = v[5];
                v[5] = v[2];
                v[2] = buf;
                break;
            }
            case 'W':{
                buf = v[0];
                v[0] = v[2];
                v[2] = v[5];
                v[5] = v[3];
                v[3] = buf;
                break;
            }
            case 'S':{
                buf = v[0];
                v[0] = v[4];
                v[4] = v[5];
                v[5] = v[1];
                v[1] = buf;
                break;
            }
        }
    }
    int operator[](size_t i){return v[i];}
private:
    int v[6];
};

Compiler output:
main.c:1:1: error: unknown type name 'class'
    1 | class dice{
      | ^~~~~
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    1 | class dice{
      |           ^
Language: C

#include <stdio.h>
int main(void){
    int i;
    int dice[7];
    char order[101];
    
    for(i=1;i<=6;i++){
        scanf("%d",&dice[i]);
    }
    scanf("%s",order);
    
    for(i=0;order[i]!='\0';i++){
        dice[0]=dice[1];
        
        switch(order[i]){
            case 'E'
            dice[1]=dice[4];
            dice[4]=dice[6];
            dice[6]=dice[3];
            dice[3]=dice[0];
            break;
            
            case 'N'
            dice[1]=dice[2];
            dice[2]=dice[6];
            dice[6]=dice[5];
            dice[5]=dice[0];
            break;
            
            case 'S'
            dice[1]=dice[5];
            dice[5]=dice[6];
            dice[6]=dice[2];
            dice[2]=dice[0];
            break;
            
            case 'W'
            dice[1]=dice[3];
            dice[3]=dice[6];
            dice[6]=dice[4];
            dice[4]=dice[0];
            break;
        }
    }
    
    printf("%d\n",dice[1]);
    
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:17:13: error: expected ':' or '...' before 'dice'
   17 |             dice[1]=dice[4];
      |             ^~~~
main.c:24:13: error: expected ':' or '...' before 'dice'
   24 |             dice[1]=dice[2];
      |             ^~~~
main.c:31:13: error: expected ':' or '...' before 'dice'
   31 |             dice[1]=dice[5];
      |             ^~~~
main.c:38:13: error: expected ':' or '...' before 'dice'
   38 |             dice[1]=dice[3];
      |             ^~~~
main.c:17:25: warning: statement will never be executed [-Wswitch-unreachable]
   17 |             dice[1]=dice[4];
      |                     ~~~~^~~
Language: C

#include <stdio.h>
int main(){
 
  int d[6],i,blank;
  char ENSW[100];
 
  for(i = 0; i < 6; i++){
 
    scanf("%d",&d[i]);
 
  }
 
  scanf("%s",ENSW);
   
  for(i = 0; ENSW[i] != '\0'; i++){
 
    if(ENSW[i] == 'N'){
 
      blank=d[0];
      d[0]=d[1];
      d[1]=d[5];
      d[5]=d[4];
      d[4]=blank;
 
    }
 
    if(ENSW[i] == 'E'){
 
      blank=d[0];
      d[0]=d[3];
      d[3]=d[5];
      d[5]=d[2];
      d[2]=blank;
 
    }
 
    if(ENSW[i] == 'S'){
 
      blank=d[0];
      d[0]=d[4];
      d[4]=d[5];
      d[5]=d[1];
      d[1]=blank;
 
    }
 
    if(ENSW[i] == 'W'){
 
      blank=d[0];
      d[0]=d[2];
      d[2]=d[5];
      d[5]=d[3];
      d[3]=blank;
 
    }
 
  }
   
  printf("%d\n",d[0]);
 
  return 0;


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

#include <stdio.h>
int main(){
 
  int d[6],i,blank;
  char ENSW[100];
 
  for(i = 0; i < 6; i++){
 
    scanf("%d",&d[i]);
 
  }
 
  scanf("%s",ENSW);
   
  for(i = 0; ENSW[i] != '\0'; i++){
 
    if(ENSW[i] == 'N'){
 
      blank=d[0];
      d[0]=d[1];
      d[1]=d[5];
      d[5]=d[4];
      d[4]=blank;
 
    }
 
    if(ENSW[i] == 'E'){
 
      blank=d[0];
      d[0]=d[3];
      d[3]=d[5];
      d[5]=d[2];
      d[2]=blank;
 
    }
 
    if(ENSW[i] == 'S'){
 
      blank=d[0];
      d[0]=d[4];
      d[4]=d[5];
      d[5]=d[1];
      d[1]=blank;
 
    }
 
    if(ENSW[i] == 'W'){
 
      blank=d[0];
      d[0]=d[2];
      d[2]=d[5];
      d[5]=d[3];
      d[3]=blank;
 
    }
 
  }
   
  printf("%d\n",d[0]);
 
  return 0;
｝


Compiler output:
main.c: In function 'main':
main.c:62:1: error: '\U0000ff5d' undeclared (first use in this function)
   62 | ｝
      | ^~
main.c:62:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:62:3: error: expected ';' at end of input
   62 | ｝
      |   ^
      |   ;
main.c:62:1: error: expected declaration or statement at end of input
   62 | ｝
      | ^~
Language: C

#include<stdio.h>
int rot[5][7] = {{0,1,2,3,4,5,6},{0,2,6,3,4,1,5},{0,4,2,1,6,5,3},{0,3,2,6,1,5,4},{0,5,1,3,4,6,2}};
int assign[7];
// サイコロの1～6の各面に割り当てる数字int tr['Z'];
void dice_init(int *a){
    int i;
    int t[5] = {0,'N','E','W','S'};
    for (i = 1; i <= 6; i++) assign[i] = a[i];
    for (i = 1; i <= 4; i++) tr[t[i]] = i;
    
}char s[102];
int main(){
    int i, k1, k2;
    int a[7], dice[2][7];
    char *p;
    for (i = 1; i <= 6; i++) scanf("%d", a+i);
    dice_init(a);
    scanf("%s", p=s);
    for (i = 1; i <= 6; i++) dice[0][i] = rot[0][i];
    for (k1 = 0, k2 = 1;
    *p; k1 = k2, k2 = !k2) { for (i = 1; i <= 6; i++) dice[k2][i] = dice[k1][rot[tr[*p]][i]]; p++;
    }
    printf("%d\n", assign[dice[k1][1]]);
    return 0;
    
}


Compiler output:
main.c: In function 'dice_init':
main.c:9:30: error: 'tr' undeclared (first use in this function); did you mean 't'?
    9 |     for (i = 1; i <= 4; i++) tr[t[i]] = i;
      |                              ^~
      |                              t
main.c:9:30: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:21:82: error: 'tr' undeclared (first use in this function)
   21 |     *p; k1 = k2, k2 = !k2) { for (i = 1; i <= 6; i++) dice[k2][i] = dice[k1][rot[tr[*p]][i]]; p++;
      |                                                                                  ^~
Language: C

#include<stdio.h>


int   i,N[7],T,F,R,t;
char  S[105];
int   main()
{
	for(i=1;i<=6;i++) scanf("%d",N+i);
	
	gets(S);
	gets(S);
	
	for(T=1,F=2,R=3,i=0;S[i];i++)
	

	{
		switch(S[i])
		{
		case 'N':t=T,T=F,F=7-t;break;
		case 'E':t=R,R=T,T=7-t;break;
		case 'S':t=F,F=T,T=7-t;break;
		case 'W':t=T,T=R,R=7-t;break;
		}
	}
	printf("%d\n",N[T]);
	
	
	return  0;
	
	
}



Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   10 |         gets(S);
      |         ^~~~
      |         fgets
Language: C

#include<stdio.h>


int   i,N[7],T,F,R,t;
char  S[105];
int   main()
{
	for(i=1;i<=6;i++) scanf("%d",N+i);
	
	gets(S);
	gets(S);
	
	for(T=1,F=2,R=3,i=0;S[i];i++)
	
{
	
		switch(S[i])
		{
		case 'N' :t=T,T=F,F=7-t;break;
		case 'E' :t=R,R=T,T=7-t;break;
		case 'S' :t=F,F=T,T=7-t;break;
		case 'W':t=T,T=R,R=7-t;break;
		}
}
	printf("%d\n",N[T]);
	
	
	return  0;
	
	
}



Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   10 |         gets(S);
      |         ^~~~
      |         fgets
Language: C

#include<stdio.h>


int   i,N[7],T,F,R,t;
char  S[105];
int   main()
{
	for(i=1;i<=6;i++) scanf("%d",N+i);
	
	gets(S);
	
	gets(S);
	
	for(T=1,F=2,R=3,i=0;S[i];i++);
	
{
	
		switch(S[i])
		{
		case 'N' :t=T,T=F,F=7-t; break;
		case 'E' :t=R,R=T,T=7-t; break;
		case 'S' :t=F,F=T,T=7-t; break;
		case 'W':t=T,T=R,R=7-t;  break;
		}
}
	printf ("%d\n",N[T]);
	
	
	return  0;
	
	
}



Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   10 |         gets(S);
      |         ^~~~
      |         fgets
Language: C

#include<stdio.h>


int   i,N[7],T,F,R,t;
char  S[105];
int   main()
{
	for(i=1;i<=6;i++) scanf("%d",N+i);
	
	gets(S);
	
	gets(S);
	
	for(T=1,F=2,R=3,i=0;S[i];i++);
	
{
	
		switch(S[i])
		{
		case 'N' :t=T,T=F,F=7-t; break;
		case 'E' :t=R,R=T,T=7-t; break;
		case 'S' :t=F,F=T,T=7-t; break;
		case 'W':t=T,T=R,R=7-t;  break;
		}

	printf ("%d\n",N[T]);
}
	
	return  0;
	
	
}



Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   10 |         gets(S);
      |         ^~~~
      |         fgets
Language: C

#include <stdio.h>

    int i,N[7],T,F,R,t;
    char S[105];
int main(void){
        for(i=1;i<=6;i++)scanf("%d",N+i);
        gets(S);
        gets(S);
        for(T=1,F=2,R=3,i=0;S[i];i++)
    {
        switch(S[i])
        {
        case 'N':t=T,T=F,F=7-t;break;
        case 'E':t=R,R=T,T=7-t;break;
        case 'S':t=F,F=T,T=7-t;break;
        case 'W':t=T,T=R,R=7-t;break;
        }
    }
    printf("%d\n",N[T]);
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    7 |         gets(S);
      |         ^~~~
      |         fgets
Language: C

#include <stdio.h>
int i,N[7],T,F,R,t;
char S[105];
int main( ){
        for(i=1;i<=6;i++)scanf("%d",N+i);
        gets(S);
        gets(S);
        
    for(T=1,F=2,R=3,i=0;S[i];i++)
    {
        switch(S[i])
        {
        case 'N':t=T,T=F,F=7-t;break;
        case 'E':t=R,R=T,T=7-t;break;
        case 'S':t=F,F=T,T=7-t;break;
        case 'W':t=T,T=R,R=7-t;break;
        }
    }
    printf("%d\n",N[T]);
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    6 |         gets(S);
      |         ^~~~
      |         fgets
Language: C++

#include <iostream>

class Dice {
    public:
        int label[7];
        Dice() {};
        void turn_dice(char c) {
            assert(c == 'S' || c == 'E' || c == 'N' || c == 'W');
            if(c == 'S') {
               int w = label[5];
               label[5] = label[6];
               label[6] = label[2];
               label[2] = label[1];
               label[1] = w;
            }
            else if(c == 'E') {
                int w = label[4];
                label[4] = label[6];
                label[6] = label[3];
                label[3] = label[1];
                label[1] = w;
            }
            else if(c == 'N') {
                int w = label[2];
                label[2] = label[6];
                label[6] = label[5];
                label[5] = label[1];
                label[1] = w;
            }
            else if(c == 'W') {
                int w = label[3];
                label[3] = label[6];
                label[6] = label[4];
                label[4] = label[1];
                label[1] = w;
            }
        };
};

int main() {
    Dice dice1;
    char s[102];
    for(int i = 1; i <= 6; i++) {
       std::cin >> dice1.label[i];
    }
    std::cin >> s;
    for(int j = 0; s[j] != '\0'; j++) {
        dice1.turn_dice(s[j]);
    }
    std::cout << dice1.label[1] << std::endl;

    return 0;
}



Compiler output:
a.cc: In member function 'void Dice::turn_dice(char)':
a.cc:8:13: error: 'assert' was not declared in this scope
    8 |             assert(c == 'S' || c == 'E' || c == 'N' || c == 'W');
      |             ^~~~~~
a.cc:2:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    1 | #include <iostream>
  +++ |+#include <cassert>
    2 |
Language: C++

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

class Dice{
  private:
    int* num;
  public:
    Dice(){
      num = new int[6];
    };
    ~Dice(){
      delete[] num;
    };
    void DiceSet(int index, int x){
      num[index] = x;
    };
    void DiceRoll(char x){
      int swp;
      switch(x){
        case 'E':
	  SwapFour(num[0],num[2],num[5],num[3]);
	  break;
	case 'S':
	  SwapFour(num[0],num[1],num[5],num[4]);
	  break;
	case 'W':
	  SwapFour(num[0],num[3],num[5],num[2]);
	  break;
	case 'N':
	  SwapFour(num[0],num[4],num[5],num[1]);
	  break;
      }
    };
    int DicePutTop(){
      return num[0];
    }
  private:
    // a->b->c->d->a
    void SwapFour(int &a, int &b, int &c, int &d){
      a ^= b; b ^= a; a ^= b;
      a ^= c; c ^= a; a ^= c;
      a ^= d; d ^= a; a ^= d;
    }
};

int main(){
  Dice dice;
  int label;
  char com;
  string s;

  for(int i=0;i<6;i++){
    cin >> label;
    dice.DiceSet(i,label);
  }
  cin >> s;
  for(int i=0;i<s.size();i++) dice.DiceRoll(s[i]);



Compiler output:
a.cc: In function 'int main()':
a.cc:58:51: error: expected '}' at end of input
   58 |   for(int i=0;i<s.size();i++) dice.DiceRoll(s[i]);
      |                                                   ^
a.cc:47:11: note: to match this '{'
   47 | int main(){
      |           ^
Language: C++

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

using namespace std;

class Dice
{
	const int NUM_S = 6;
	int a[NUM_S];

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];
	}

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

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

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

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

}

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

	dc.set(st);

	string od;
	cin >> od;
	int ans = st[1];
	for (unsigned int i = 0; i < od.length(); ++i) {
		switch (od[i]) {
			case 'N':
				ans = dc.rn();
				break;
			case 'S':
				ans = dc.rs();
				break;
			case 'E':
				ans = dc.re();
				break;
			case 'W':
				ans = dc.rw();
				break;
	}

	cout << ans << endl;
	return 0;
}



Compiler output:
a.cc:11:15: error: invalid use of non-static data member 'Dice::NUM_S'
   11 |         int a[NUM_S];
      |               ^~~~~
a.cc:10:19: note: declared here
   10 |         const int NUM_S = 6;
      |                   ^~~~~
a.cc:50:2: error: expected ';' after class definition
   50 | }
      |  ^
      |  ;
a.cc: In member function 'void Dice::set(int*)':
a.cc:17:17: error: 'a' was not declared in this scope; did you mean '_a'?
   17 |                 a[0] = _a[0]; a[1] = _a[1];
      |                 ^
      |                 _a
a.cc: In member function 'int Dice::rs()':
a.cc:23:27: error: 'a' was not declared in this scope
   23 |                 int tmp = a[1];
      |                           ^
a.cc: In member function 'int Dice::re()':
a.cc:30:27: error: 'a' was not declared in this scope
   30 |                 int tmp = a[1];
      |                           ^
a.cc: In member function 'int Dice::rn()':
a.cc:37:27: error: 'a' was not declared in this scope
   37 |                 int tmp = a[1];
      |                           ^
a.cc: In member function 'int Dice::rw()':
a.cc:44:27: error: 'a' was not declared in this scope
   44 |                 int tmp = a[1];
      |                           ^
a.cc: In function 'int main()':
a.cc:81:2: error: expected '}' at end of input
   81 | }
      |  ^
a.cc:53:1: note: to match this '{'
   53 | {
      | ^
Language: C++

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

using namespace std;

class Dice
{
	const static int NUM_S = 6;
	int a[NUM_S];

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];
	}

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

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

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

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

}

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

	dc.set(st);

	string od;
	cin >> od;
	int ans = st[1];
	for (unsigned int i = 0; i < od.length(); ++i) {
		switch (od[i]) {
			case 'N':
				ans = dc.rn();
				break;
			case 'S':
				ans = dc.rs();
				break;
			case 'E':
				ans = dc.re();
				break;
			case 'W':
				ans = dc.rw();
				break;
	}

	cout << ans << endl;
	return 0;
}



Compiler output:
a.cc:50:2: error: expected ';' after class definition
   50 | }
      |  ^
      |  ;
a.cc: In function 'int main()':
a.cc:81:2: error: expected '}' at end of input
   81 | }
      |  ^
a.cc:53:1: note: to match this '{'
   53 | {
      | ^
Language: C++

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

using namespace std;

class Dice
{
	const static int NUM_S = 6;
	int a[NUM_S];

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];
	}

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

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

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

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

};

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

	dc.set(st);

	string od;
	cin >> od;
	int ans = st[1];
	for (unsigned int i = 0; i < od.length(); ++i) {
		switch (od[i]) {
			case 'N':
				ans = dc.rn();
				break;
			case 'S':
				ans = dc.rs();
				break;
			case 'E':
				ans = dc.re();
				break;
			case 'W':
				ans = dc.rw();
				break;
	}

	cout << ans << endl;
	return 0;
}



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

#include<iostream>
using namespace std;

int main(){
        const int n = 6;
        int dice[n] ;
        string s;
        string haki;
        const int dice_tem[4][6] ={ {2,6,3,4,1,5},{5,1,3,4,6,2},
                                    {1,4,2,5,3,6},{1,3,5,2,4,6}};
        int dice_result[6];
        for(int i = 0; i < n; i++){
                cin  >>dice[i];
        }
        getline(cin ,haki);
        getline(cin,s);
        int s_len = s.length();
        for(int i = 0; i < s_len;i++){
                int dice_flag = -1;
                switch(s[i]){
                case 78: //N
                        dice_flag = 0;
                        break;
                case 83: //S
                        dice_flag = 1;
                        break;
                case 69: //E
                        dice_flag = 2;
                        break;
                case 87: //W
                        dice_flag = 3;
                        break;
                default :
                        break;
                }
                if(dice_flag == -1)continue;
                for(int i = 0; i < n ;i++){                
                    for(int i = 0; i < n ;i++){
                        dice_result[i] =
                         dice[dice_tem[dice_flag][i]-1];
                }for(int i = 0; i < n; i++)dice[i] = dice_result[i];
        }
        cout << dice[1] << endl;
        return 0;
}


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

#include<iostream>
#include<string>
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:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | class Cube{
      |           ^
a.cc: In constructor 'Cube::Cube()':
a.cc:9:16: error: a function-definition is not allowed here before '{' token
    9 |   void roll_z(){roll(1,2,4,3);}
      |                ^
a.cc:10:16: error: a function-definition is not allowed here before '{' token
   10 |   void roll_y(){roll(0,2,5,3);}
      |                ^
a.cc:11:16: error: a function-definition is not allowed here before '{' token
   11 |   void roll_x(){roll(0,1,5,4);}
      |                ^
a.cc:12:38: error: a function-definition is not allowed here before '{' token
   12 |   void roll(int i,int j,int k, int l){
      |                                      ^
a.cc:15:21: error: a function-definition is not allowed here before '{' token
   15 |   void move(char ch){
      |                     ^
a.cc: In member function 'int Cube::main()':
a.cc:30:36: error: 'class Cube' has no member named 'move'
   30 |     for(int i=0;i<com.size();i++)c.move(com[i]);
      |                                    ^~~~
a.cc: At global scope:
a.cc:33:2: error: expected unqualified-id at end of input
   33 | }
      |  ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int a[6];
  int d[6] = {0,1,2,3,4,5};
  char r;

  for(int i=0; i<6; i++){
    cin >> a[i];
  }

  int n[6] = {4,0,2,3,5,1};
  int e[6] = {2,1,5,0,4,3};
  int s[6] = {1,5,2,3,0,4};
  int w[6] = {3,1,0,5,4,2};

  while(cin >> r){
    cout << r << endl;
    if(r=='N'){
      for(int i=0; i<6; i++){
        d[i] = n[d[i]];
      }
    } else if(r=='E'){
      for(int i=0; i<6; i++){
        d[i] = e[d[i]];
      }
    } else if(r=='S'){
      for(int i=0; i<6; i++){
        d[i] = s[d[i]];
      }
    } else if(r=='W'){
      for(int i=0; i<6; i++){
        d[i] = w[d[i]];
      }
    }
  for(int i=0; i<6; i++){
    if(d[i] == 0)cout << a[i] << endl;
  }
}



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

#include<iostream>
#include<string>
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 function 'int main()':
a.cc:27:14: error: 'C' was not declared in this scope
   27 |         cin>>C.f[i];
      |              ^
Language: C++

#include<iostream>
#include<string>
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 function 'int main()':
a.cc:31:9: error: 'c' was not declared in this scope
   31 |         c.move(com[i]);
      |         ^
a.cc:33:11: error: 'c' was not declared in this scope
   33 |     cout<<c.f[0]<<endl;
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;

int main()
{
    int dice[6];
    for(int i=0; i<6; ++i){
        cin >> dice[i];
    }

    string s;
    cin >> s;
    for(const auto& c: s){
        switch(c){
            case('S'):
                int tmp;
                tmp = dice[5];
                dice[5] = dice[1];
                dice[2] = dice[0];
                dice[0] = dice[4];
                dice[4] = tmp;
                break;
            case('N'):
                int tmp;
                tmp = dice[5];
                dice[5] = dice[4];
                dice[4] = dice[0];
                dice[0] = dice[1];
                dice[4] = tmp;
                break;
            case('E'):
                int tmp;
                tmp = dice[5];
                dice[5] = dice[2];
                dice[2] = dice[0];
                dice[0] = dice[3];
                dice[3] = tmp;
                break;
            case('W'):
                int tmp;
                tmp = dice[5];
                dice[5] = dice[3];
                dice[3] = dice[0];
                dice[0] = dice[2];
                dice[2] = tmp;
                break;
        }


    }

    cout << dice[0] << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:21: error: redeclaration of 'int tmp'
   28 |                 int tmp;
      |                     ^~~
a.cc:20:21: note: 'int tmp' previously declared here
   20 |                 int tmp;
      |                     ^~~
a.cc:36:21: error: redeclaration of 'int tmp'
   36 |                 int tmp;
      |                     ^~~
a.cc:20:21: note: 'int tmp' previously declared here
   20 |                 int tmp;
      |                     ^~~
a.cc:44:21: error: redeclaration of 'int tmp'
   44 |                 int tmp;
      |                     ^~~
a.cc:20:21: note: 'int tmp' previously declared here
   20 |                 int tmp;
      |                     ^~~
Language: C++

#include<iostream>
using namespace std;

class Dice{
    public:
    int f[6];
    Cube(){}
    void roll_x(){roll(1,4,6,3);} // to E
    void roll_y(){roll(1,2,6,5);} // to N
    void roll_z(){roll(2,3,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') roll_x();
        if(ch == 'S') for(int i=0;i<3;i++) roll_y();
        if(ch == 'W') for(int i=0;i<3;i++) roll_x();
        if(ch == 'N') roll_y();
    }
}


Compiler output:
a.cc:7:5: error: ISO C++ forbids declaration of 'Cube' with no type [-fpermissive]
    7 |     Cube(){}
      |     ^~~~
a.cc:20:2: error: expected ';' after class definition
   20 | }
      |  ^
      |  ;
a.cc: In member function 'int Dice::Cube()':
a.cc:7:12: warning: no return statement in function returning non-void [-Wreturn-type]
    7 |     Cube(){}
      |            ^
Language: C++

#include<iostream>
using namespace std;

class Dice{
    public:
    int f[6];
    Dice(){}
    void roll_x(){roll(1,4,6,3);} // to E
    void roll_y(){roll(1,2,6,5);} // to N
    void roll_z(){roll(2,3,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') roll_x();
        if(ch == 'S') for(int i=0;i<3;i++) roll_y();
        if(ch == 'W') for(int i=0;i<3;i++) roll_x();
        if(ch == 'N') roll_y();
    }
}

int main(){
    Dice d;
    string name;
    
    for(int i=1;i<=6;i++) cin >> d.f[i];
    cin >> name;
    for(int i=0;i<name.size();i++) d.move(name[i]);
    cout << d.f[1] << endl;
    return 0;
}


Compiler output:
a.cc:20:2: error: expected ';' after class definition
   20 | }
      |  ^
      |  ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
struct mannji{
	int top,front,right,left,back,down;
	int oa=0,ob=0,oc=0,od=0,oe=0,of=0;
	void n(){
		oa=top;ob=front;oc=right;od=left;oe=back;of=down;
		top=ob;front=of;back=oa;down=oe;
	}
	void s(){
		oa=top;ob=front;oc=right;od=left;oe=back;of=down;
		top=oe;front=oa;back=of;down=ob;
	}
	void e(){
		oa=top;ob=front;oc=right;od=left;oe=back;of=down;
		top=od;right=oa;left=of;down=oc;		
	}
	void w(){
		oa=top;ob=front;oc=right;od=left;oe=back;of=down;
		top=oc;right=of;left=oa;down=od;	
	}
};
int main() {
	int a,b,c,d,e,f;
	string s;
	mannji k;
	k.top=a;
	
	cin>>a>>b>>c>>d>>e>>f;
	cin>>s;
	for(int i=0;i<s.length;i++){
		if(s[i]=='N');
	}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:31:25: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   31 |         for(int i=0;i<s.length;i++){
      |                       ~~^~~~~~
      |                               ()
Language: C++

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

// http://www.prefield.com/algorithm/misc/dice.html
enum FACE { TOP, BOTTOM, FRONT, BACK, LEFT, RIGHT };
class dice {
public:
	dice(int top,int front,int right,int left,int back,int bottom) {
		id[TOP] = top; id[FRONT] = front; id[RIGHT] = right;
		id[LEFT] = left; id[BACK] = back; id[BOTTOM] = bottom;
	}
	int& operator[] (FACE f) { return id[f]; }
	const int& operator[] (FACE f) const { return id[f]; }
	bool operator==(const dice &b) const {
		const dice &a = *this;
		return a[TOP] == b[TOP] && a[BOTTOM] == b[BOTTOM] &&
			a[FRONT] == b[FRONT] && a[BACK] == b[BACK] &&
			 a[LEFT] == b[LEFT] && a[RIGHT] == b[RIGHT];
	}
	void roll_north() { roll(TOP, FRONT, BOTTOM, BACK); }
	void roll_south() { roll(TOP, BACK, BOTTOM, FRONT); }
	void roll_east() { roll(TOP, LEFT, BOTTOM, RIGHT); }
	void roll_west() { roll(TOP, RIGHT, BOTTOM, LEFT); }
	void roll_right() { roll(FRONT, LEFT, BACK, RIGHT); }
	void roll_left() { roll(FRONT, RIGHT, BACK, LEFT); }
	vector<dice> all_rolls(){
		vector<dice> ret;
		for (int k = 0; k < 6; (k&1?roll_east():roll_north()),++k)
			for (int i = 0; i < 4; roll_right(), ++i)
				ret.push_back(*this);
		return ret;
	}
	bool equivalent_to(const dice& di){
		for (int k = 0; k < 6; (k&1?roll_east():roll_north()),++k)
			for (int i = 0; i < 4; roll_right(), ++i)
				if (*this == di) return true;
		return false;
	}
private:
	void roll(FACE a, FACE b, FACE c, FACE d){
		int tmp = id[a];
		id[a] = id[b]; id[b] = id[c];
		id[c] = id[d]; id[d] = tmp;
	}
	int id[6];
};

int main(){
	int d[6];
	for(int i=0;i<6;i++)cin>>d[i];
	dice di(d[0],d[1],d[2],d[3],d[4],d[5]);
	string line;
	cin>>line;
	for(int i=0;i<line.size();i++){
		if(line[i]=='N')di.roll_x();
		if(line[i]=='E')di.roll_y();
		if(line[i]=='W')di.roll_y2();
		if(line[i]=='S')di.roll_x2();
	}
	cout<<di[TOP]<<endl;
}

Compiler output:
a.cc:27:9: error: 'vector' does not name a type
   27 |         vector<dice> all_rolls(){
      |         ^~~~~~
a.cc: In function 'int main()':
a.cc:56:36: error: 'class dice' has no member named 'roll_x'; did you mean 'roll'?
   56 |                 if(line[i]=='N')di.roll_x();
      |                                    ^~~~~~
      |                                    roll
a.cc:57:36: error: 'class dice' has no member named 'roll_y'; did you mean 'roll'?
   57 |                 if(line[i]=='E')di.roll_y();
      |                                    ^~~~~~
      |                                    roll
a.cc:58:36: error: 'class dice' has no member named 'roll_y2'; did you mean 'roll'?
   58 |                 if(line[i]=='W')di.roll_y2();
      |                                    ^~~~~~~
      |                                    roll
a.cc:59:36: error: 'class dice' has no member named 'roll_x2'; did you mean 'roll'?
   59 |                 if(line[i]=='S')di.roll_x2();
      |                                    ^~~~~~~
      |                                    roll